Skip to content

Commit

Permalink
Add ui test for #100197
Browse files Browse the repository at this point in the history
Recover from mutable variable declaration where `mut` is placed before `let`
  • Loading branch information
obeis committed Aug 8, 2022
1 parent ea2df3a commit 59e4063
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/ui/parser/issue-100197-mut-let.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// run-rustfix

fn main() {
let mut _x = 123;
//~^ ERROR invalid variable declaration
}
6 changes: 6 additions & 0 deletions src/test/ui/parser/issue-100197-mut-let.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// run-rustfix

fn main() {
mut let _x = 123;
//~^ ERROR invalid variable declaration
}
8 changes: 8 additions & 0 deletions src/test/ui/parser/issue-100197-mut-let.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 59e4063

Please sign in to comment.