Skip to content

Commit

Permalink
add test for issue 89960
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacrelf committed Oct 17, 2021
1 parent 153b173 commit 38ba92f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/let-else/issue-89960.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This had an ICE, see issue #89960

#![feature(let_else)]
#![deny(unused_variables)]

fn main() {
let Some(ref mut meow) = Some(()) else { return };
//~^ ERROR unused variable: `meow`
}
14 changes: 14 additions & 0 deletions src/test/ui/let-else/issue-89960.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: unused variable: `meow`
--> $DIR/issue-89960.rs:7:22
|
LL | let Some(ref mut meow) = Some(()) else { return };
| ^^^^ help: if this is intentional, prefix it with an underscore: `_meow`
|
note: the lint level is defined here
--> $DIR/issue-89960.rs:4:9
|
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit 38ba92f

Please sign in to comment.