Skip to content

Commit 59e4063

Browse files
committed
Add ui test for #100197
Recover from mutable variable declaration where `mut` is placed before `let`
1 parent ea2df3a commit 59e4063

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// run-rustfix
2+
3+
fn main() {
4+
let mut _x = 123;
5+
//~^ ERROR invalid variable declaration
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// run-rustfix
2+
3+
fn main() {
4+
mut let _x = 123;
5+
//~^ ERROR invalid variable declaration
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: invalid variable declaration
2+
--> $DIR/issue-100197-mut-let.rs:4:5
3+
|
4+
LL | mut let _x = 123;
5+
| ^^^^^^^ help: switch the order of `mut` and `let`: `let mut`
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)