-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab4d154
commit 5f711f2
Showing
2 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// This had an ICE, see issue #89960 | ||
|
||
#![feature(let_else)] | ||
#![deny(unused_variables)] | ||
|
||
fn main() { | ||
// FIXME: more precise diagnostics | ||
let Some(ref mut meow) = Some(()) else { return }; | ||
//~^ ERROR: cannot borrow value as mutable, as `val` is not declared as mutable | ||
//~^ ERROR unused variable: `meow` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
error[E0596]: cannot borrow value as mutable, as `val` is not declared as mutable | ||
--> $DIR/issue-89960.rs:5:14 | ||
error: unused variable: `meow` | ||
--> $DIR/issue-89960.rs:7:22 | ||
| | ||
LL | let Some(ref mut meow) = Some(()) else { return }; | ||
| ---------^^^^^^^^^^^^----------------------------- | ||
| | | | ||
| | cannot borrow as mutable | ||
| help: consider changing this to be mutable: `mut val` | ||
| ^^^^ 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 | ||
|
||
For more information about this error, try `rustc --explain E0596`. |