Skip to content

Commit

Permalink
Rollup merge of rust-lang#121669 - nnethercote:count-stashed-errs-aga…
Browse files Browse the repository at this point in the history
…in, r=estebank

Count stashed errors again

Stashed diagnostics are such a pain. Their "might be emitted, might not" semantics messes with lots of things.

rust-lang#120828 and rust-lang#121206 made some big changes to how they work, improving some things, but still leaving some problems, as seen by the issues caused by rust-lang#121206. This PR aims to fix all of them by restricting them in a way that eliminates the "might be emitted, might not" semantics while still allowing 98% of their benefit. Details in the individual commit logs.

r? `@oli-obk`
  • Loading branch information
GuillaumeGomez authored Feb 29, 2024
2 parents f055f2a + 81783fb commit 7cfe7d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/ui/crashes/unreachable-array-or-slice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
struct Foo(isize, isize, isize, isize);

pub fn main() {
let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5);
match [5, 5, 5, 5] {
[..] => { }
}
}
9 changes: 9 additions & 0 deletions tests/ui/crashes/unreachable-array-or-slice.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions
--> tests/ui/crashes/unreachable-array-or-slice.rs:4:9
|
LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5);
| ^^^^ `Self` is only available in impls, traits, and type definitions

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.

0 comments on commit 7cfe7d6

Please sign in to comment.