File tree 2 files changed +13
-9
lines changed
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
+
1
3
#![ feature( let_else) ]
4
+ #![ deny( unused_variables) ]
2
5
3
6
fn main ( ) {
4
- // FIXME: more precise diagnostics
5
7
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`
7
9
}
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
3
3
|
4
4
LL | 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
+ | ^^^^^^^^^^^^^^^^
9
12
10
13
error: aborting due to previous error
11
14
12
- For more information about this error, try `rustc --explain E0596`.
You can’t perform that action at this time.
0 commit comments