File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1+ // This had an ICE, see issue #89960
2+
13#![ feature( let_else) ]
4+ #![ deny( unused_variables) ]
25
36fn main ( ) {
4- // FIXME: more precise diagnostics
57 let Some ( ref mut meow) = Some ( ( ) ) else { return } ;
6- //~^ ERROR: cannot borrow value as mutable, as `val` is not declared as mutable
8+ //~^ ERROR unused variable: `meow`
79}
Original file line number Diff line number Diff line change 1- error[E0596]: cannot borrow value as mutable, as `val` is not declared as mutable
2- --> $DIR/issue-89960.rs:5:14
1+ error: unused variable: `meow`
2+ --> $DIR/issue-89960.rs:7:22
33 |
44LL | let Some(ref mut meow) = Some(()) else { return };
5- | ---------^^^^^^^^^^^^-----------------------------
6- | | |
7- | | cannot borrow as mutable
8- | help: consider changing this to be mutable: `mut val`
5+ | ^^^^ help: if this is intentional, prefix it with an underscore: `_meow`
6+ |
7+ note: the lint level is defined here
8+ --> $DIR/issue-89960.rs:4:9
9+ |
10+ LL | #![deny(unused_variables)]
11+ | ^^^^^^^^^^^^^^^^
912
1013error: aborting due to previous error
1114
12- For more information about this error, try `rustc --explain E0596`.
You can’t perform that action at this time.
0 commit comments