- 08 8月, 2021 16 次提交
-
-
由 bors 提交于
Avoid using the `copy_nonoverlapping` wrapper through `mem::replace`. This is a much simpler way to achieve the pre-#86003 behavior of `mem::replace` not needing dynamically-sized `memcpy`s (at least before inlining), than re-doing #81238 (which needs #86699 or something similar). I didn't notice it until recently, but `ptr::write` already explicitly avoided using the wrapper, while `ptr::read` just called the wrapper (and was the reason for us observing any behavior change from #86003 in Rust-GPU). <hr/> The codegen test I've added fails without the change to `core::ptr::read` like this (ignore the `v0` mangling, I was using a worktree with it turned on by default, for this): ```llvm 13: ; core::intrinsics::copy_nonoverlapping::<u8> 14: ; Function Attrs: inlinehint nonlazybind uwtable 15: define internal void `@_RINvNtCscK5tvALCJol_4core10intrinsics19copy_nonoverlappinghECsaS4X3EinRE8_25mem_replace_direct_memcpy(i8*` %src, i8* %dst, i64 %count) unnamed_addr #0 { 16: start: 17: %0 = mul i64 %count, 1 18: call void `@llvm.memcpy.p0i8.p0i8.i64(i8*` align 1 %dst, i8* align 1 %src, i64 %0, i1 false) not:17 !~~~~~~~~~~~~~~~~~~~~~ error: no match expected 19: ret void 20: } ``` With the `core::ptr::read` change, `core::intrinsics::copy_nonoverlapping` doesn't get instantiated and the test passes. <hr/> r? `@m-ou-se` cc `@nagisa` (codegen test) `@oli-obk` / `@RalfJung` (miri diagnostic changes)
-
由 Eduard-Mihai Burtescu 提交于
-
由 bors 提交于
Change proc_macro::Diagnostics docs With Rust 1.54 attributes can invoke function-like macros. This allows functions generated by macros to have non-generic documentation. This pull request changes the documentation of `proc_macro::Diagnostics` to be more specific and include a link to the level. ## Example Before: ```markdown Adds a new child diagnostic message to `self` with the level identified by this method’s name with the given `message`. ``` After: ```markdown Adds a new child diagnostic message to self with the [`Level::Error`] level, and the given `message`. ```
-
由 bors 提交于
encode `generics_of` for fields and ty params Fixes #87674 Fixes #87603 ICE was caused by calling `generics_of` on a `DefId` without any `generics_of` results. This was happening when we call `generics_of` on parent `DefId`s of an unevaluated const when we evaluate it. r? `@lcnr`
-
由 bors 提交于
PassWrapper: handle move of OptimizationLevel class out of PassBuilder This is the first build break of the LLVM 14 cycle, and was caused by https://reviews.llvm.org/D107025. Mercifully an easy fix.
-
由 Klim Tsoutsman 提交于
-
由 bors 提交于
impl Default, Copy, Clone for std::io::Sink and Empty The omission of `Sink: Default` is causing me a slight inconvenience in a test harness. There seems little reason for this and `Empty` not to be `Clone` and `Copy` too. I have made all three of these insta-stable, because: AIUI `Copy` can only be derived, and I was not able to find any examples of how to unstably derive it. I think it is probably not possible. I hunted through the git history for precedent and found > 79b8ad84 > Implement `Copy` for `IoSlice` > https://github.com/rust-lang/rust/pull/69403 which was also insta-stable.
-
由 bors 提交于
Move naked function ABI check to its own lint This check was previously categorized under the lint named `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will be turned into an error in a future release. However, as defined in the Constrained Naked Functions RFC, this check should only be a warning. This is because it is possible for a naked function to be implemented in such a way that it does not break even the undefined ABI. For example, a `jmp` to a `const`. Therefore, this patch defines a new lint named `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check. Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI` will not be converted to an error in the future. rust-lang/rfcs#2774 rust-lang/rfcs#2972
-
由 bors 提交于
Prepare call/invoke for opaque pointers Rather than relying on `getPointerElementType()` from LLVM function pointers, we now pass the function type explicitly when building `call` or `invoke` instructions.
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #87744 (Add x.py option to --force-rerun compiletest tests) - #87789 (Make vec-shrink-panic test compatible with v0 mangling) - #87833 (Fix typo -- "The" -> "They") - #87834 (Fix small typo) - #87838 (Document that fs::read_dir skips . and ..) - #87842 (Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Yuki Okushi 提交于
Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked Recently, I edited the import list of the `core::iter::traits::iterator` module (in #85874). This results in a broken intra doc link in a hidden documentation with the effect that `RUSTDOCFLAGS='--document-private-items --document-hidden-items' x doc library/std` fails. (This can be worked around by adding `-Arustdoc::broken-intra-doc-links`; still, it’s a broken link so let’s fix it.) ``@rustbot`` label C-cleanup, T-libs
-
由 Yuki Okushi 提交于
Document that fs::read_dir skips . and .. Hi, I think this is worth noting in the docs since it differs from POSIX `readdir`. I didn’t put it under platform-specific notes because it seems to be consistent across platforms, and changing this behavior in the future could cause pretty nasty bugs. Thanks!
-
由 Yuki Okushi 提交于
Fix small typo The closing backtick was outside the closing bracket, which is why the intra-doc link wasn't working.
-
由 Yuki Okushi 提交于
Fix typo -- "The" -> "They" I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
-
由 Yuki Okushi 提交于
Make vec-shrink-panic test compatible with v0 mangling The v0 mangling includes an instantiating crate in a mangled name, which crates a false positive match for a word `panic`. Rename crate name / test case to avoid the issue.
-
由 Yuki Okushi 提交于
Add x.py option to --force-rerun compiletest tests This can be used like `./x.py test src/test/ui/abi/ --force-rerun`, and is useful when verifying that newly blessed tests don't change between test runs (such as due to being dependent on the current time or memory layout or RNG), without needing to change the test file or find the right file in `build` to remove.
-
- 07 8月, 2021 21 次提交
-
-
由 bors 提交于
update Miri Fixes https://github.com/rust-lang/rust/issues/87778 r? `@ghost`
-
由 Ralf Jung 提交于
-
由 Nathaniel McCallum 提交于
-
由 Klim Tsoutsman 提交于
Add links Fit 100-character limit
-
由 bors 提交于
current_exe haiku code path simplification all of these part of libc
-
由 Frank Steffahn 提交于
-
由 Timotej Lazar 提交于
-
由 bors 提交于
Update socket2 dependency from 0.4.0 to 0.4.1 This update contains a fix for building the tools that depend on this package on Haiku (tier 3).
-
由 bors 提交于
Hide allocator details from TryReserveError I think there's [no need for TryReserveError to carry detailed information](https://github.com/rust-lang/rust/issues/48043#issuecomment-825139280), but I wouldn't want that issue to delay stabilization of the `try_reserve` feature. So I'm proposing to stabilize `try_reserve` with a `TryReserveError` as an opaque structure, and if needed, expose error details later. This PR moves the `enum` to an unstable inner `TryReserveErrorKind` that lives under a separate feature flag. `TryReserveErrorKind` could possibly be left as an implementation detail forever, and the `TryReserveError` get methods such as `allocation_size() -> Option<usize>` or `layout() -> Option<Layout>` instead, or the details could be dropped completely to make try-reserve errors just a unit struct, and thus smaller and cheaper.
-
由 Noah Lev 提交于
The closing backtick was outside the closing bracket, which is why the intra-doc link wasn't working.
-
由 await Marsha 提交于
I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
-
由 bors 提交于
Fix typo Add missing "by".
-
由 Augie Fackler 提交于
This is the first build break of the LLVM 14 cycle, and was caused by https://reviews.llvm.org/D107025. Mercifully an easy fix.
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #85807 (bootstrap: Disable initial-exec TLS model on powerpc) - #87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - #87775 (Add hint for unresolved associated trait items if the trait has a single item) - #87779 (Remove special case for statement `NodeId` assignment) - #87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - #87809 (Fix typo in the ptr documentation) - #87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Yuki Okushi 提交于
Sync rustc_codegen_cranelift 05677b6b removes two assertions that should have been removed in https://github.com/rust-lang/rust/pull/87515. They are no longer correct and trigger while compiling the sysroot. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
-
由 Yuki Okushi 提交于
Fix typo in the ptr documentation Spotted a minor typo in the docs ;). Pointers are cool!
-
由 Yuki Okushi 提交于
Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort` The function originally has `C` ABI but is called using `C-unwind` ABI in `std`: https://github.com/rust-lang/rust/blob/d4ad1cfc63ba5824196bfb2370451ddb5af2e020/library/std/src/panicking.rs#L49-L54 Which might be [problematic](https://github.com/rust-lang/miri/pull/1745#discussion_r596096876) and triggers this [Miri error](https://github.com/rust-lang/rust/issues/87778#issuecomment-893306222): ``` error: Undefined Behavior: calling a function with ABI C using caller ABI C-unwind --> /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:672:9 | 672 | __rust_start_panic(obj) | ^^^^^^^^^^^^^^^^^^^^^^^ calling a function with ABI C using caller ABI C-unwind | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information ``` Changing the ABI of the function to `C-unwind` fixes the error above.
-
由 Yuki Okushi 提交于
Remove special case for statement `NodeId` assignment We now let `noop_flat_map_stmt` assign `NodeId`s (via `visit_id`), just as we do for other AST nodes.
-
由 Yuki Okushi 提交于
Add hint for unresolved associated trait items if the trait has a single item This PR introduces a special-cased hint for unresolved trait items paths. It is shown if: - the path was not resolved to any existing trait item - and no existing trait item's name was reasonably close with regard to edit distance - and the trait only has a single item in the corresponding namespace I didn't know where I should put tests, therefore so far I just managed to bless two existing tests. I would be glad for hints where should tests for a hint like this be created, how should they be named (with reference to the original issue?) and what tests should I create (is it enough to test it just for types? or create separate tests also for functions and constants?). It could also be turned into a machine applicable suggestion I suppose. This is my first `rustc` PR, so please go easy on me :) Fixes: https://github.com/rust-lang/rust/issues/87638
-
由 Yuki Okushi 提交于
Fix overflow in rustc happening if the `err_count()` is reduced in a stage. This can happen if stashed diagnostics are removed or replaced with fewer errors. The semantics stay the same if built without overflow checks. Fixes #84219. Background: I came across this independently by running `RUSTFLAGS="-C overflow-checks=on" ./x.py test`. Fixing this will allow us to move on and find further overflow errors with testing or fuzzing.
-
由 Yuki Okushi 提交于
bootstrap: Disable initial-exec TLS model on powerpc Fixes #81334.
-
- 06 8月, 2021 3 次提交
-
-
由 bors 提交于
Add config.toml options for enabling overflow checks in rustc and std The names are `overflow-checks` and `overflow-checks-std` and they work similar to `debug-assertions` and `debug-assertions-std`. Once added we can measure how big the performance impact actually is and maybe enable them for CI tests. Enabling them already makes two ui tests fail: ``` failures: [ui] ui/parser/item-free-const-no-body-semantic-fail.rs [ui] ui/parser/item-free-static-no-body-semantic-fail.rs ``` (See #84219 and #87761.)
-
由 Aaron Hill 提交于
We now let `noop_flat_map_stmt` assign `NodeId`s (via `visit_id`), just as we do for other AST nodes.
-
由 bjorn3 提交于
-