-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 5 pull requests #133086
Rollup of 5 pull requests #133086
Conversation
…usedBraces` checking `break`
...rather than a future error
the internal representation of `std::sync::Mutex` depends on the compilation target. due to this, the compiler produces different number of errors for UI test `issue-17431-6.rs` depending on the compilation target. for example, when compiling the UI test to an `*-apple-*` or `*-qnx7*` target, the "cycle detected" error is not reported ``` console $ cat src/lib.rs use std::sync::Mutex; enum Foo { X(Mutex<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size ``` whereas rustc produces two errors for other OSes, like Linux, which is what the UI test expects ``` console $ cargo check --target x86_64-unknown-linux-gnu 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` this commit replaces the problematic `Mutex` with `UnsafeCell`, which has the same internal representation regardless of the compilation target. with that change, rustc reports two errors for all compilation targets. ``` console $ cat src/lib.rs use std::cell::UnsafeCell; enum Foo { X(UnsafeCell<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` with this change, we can remove the `ignore-apple` directive as the UI test now also passes on apple targets.
This fixes a problem where code generated by an external macro with an RPIT would end up using the call-site edition instead of the macro's edition for the RPIT. When used from a 2024 crate, this caused the code to change behavior to the 2024 capturing rules, which we don't want. This was caused by the impl-trait lowering code would replace the span with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it was also overriding the edition of the span with the edition of the local crate. Instead it should be using the edition of the span itself. Fixes rust-lang#132917
For expr `return (_ = 42);` unused_paren lint should not be triggered fixes rust-lang#131989
…ochenkov Add visit_coroutine_kind to ast::Visitor r? ``@petrochenkov`` related to rust-lang#128974
…kind, r=compiler-errors Mention both release *and* edition breakage for never type lints This PR makes ~~two changes~~ a change to the never type lints (`dependency_on_unit_never_type_fallback` and `never_type_fallback_flowing_into_unsafe`): 1. Change the wording of the note to mention that the breaking change will be made in an edition _and_ in a future release 2. ~~Make these warnings be reported in deps (hopefully the lints are matured enough)~~ r? ``@compiler-errors`` cc ``@ehuss`` closes rust-lang#132930
…tic, r=Noratrieb make UI test OS-agnostic the internal representation of `std::sync::Mutex` depends on the compilation target. due to this, the compiler produces different number of errors for UI test `issue-17431-6.rs` depending on the compilation target. for example, when compiling the UI test to an `*-apple-*` or `*-qnx7*` target, the "cycle detected" error is not reported ``` console $ cat src/lib.rs use std::sync::Mutex; enum Foo { X(Mutex<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size ``` whereas rustc produces two errors for other OSes, like Linux, which is what the UI test expects ``` console $ cargo check --target x86_64-unknown-linux-gnu 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` this commit replaces the problematic `Mutex` with `UnsafeCell`, which has the same internal representation regardless of the compilation target. with that change, rustc reports two errors for all compilation targets. ``` console $ cat src/lib.rs use std::cell::UnsafeCell; enum Foo { X(UnsafeCell<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` with this change, we can remove the `ignore-apple` directive as the UI test now also passes on apple targets.
…iler-errors Fix span edition for 2024 RPIT coming from an external macro This fixes a problem where code generated by an external macro with an RPIT would end up using the call-site edition instead of the macro's edition for the RPIT. When used from a 2024 crate, this caused the code to change behavior to the 2024 capturing rules, which we don't want. This was caused by the impl-trait lowering code would replace the span with one marked with `DesugaringKind::OpaqueTy` desugaring. However, it was also overriding the edition of the span with the edition of the local crate. Instead it should be using the edition of the span itself. Fixes rust-lang#132917
@bors r+ p= rollup=never |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 917a50a039 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (d3a4b1f): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 2.1%, secondary 1.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 19.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 788.599s -> 791.497s (0.37%) |
Successful merges:
return (_ = 42);
unused_paren lint should not be triggered #132936 (For exprreturn (_ = 42);
unused_paren lint should not be triggered)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup