1
Fork 0

Add ui test for #100197

Recover from mutable variable declaration where `mut` is placed before `let`
This commit is contained in:
Obei Sideg 2022-08-08 03:21:01 +03:00
parent ea2df3a798
commit 59e406390c
3 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,6 @@
// run-rustfix
fn main() {
let mut _x = 123;
//~^ ERROR invalid variable declaration
}

View file

@ -0,0 +1,6 @@
// run-rustfix
fn main() {
mut let _x = 123;
//~^ ERROR invalid variable declaration
}

View file

@ -0,0 +1,8 @@
error: invalid variable declaration
--> $DIR/issue-100197-mut-let.rs:4:5
|
LL | mut let _x = 123;
| ^^^^^^^ help: switch the order of `mut` and `let`: `let mut`
error: aborting due to previous error