-
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.
Rollup merge of #100253 - obeis:issue-100197, r=cjgillot
Recover from mutable variable declaration where `mut` is placed before `let` Closes #100197
- Loading branch information
Showing
4 changed files
with
33 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// run-rustfix | ||
|
||
fn main() { | ||
let mut _x = 123; | ||
//~^ ERROR invalid variable declaration | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// run-rustfix | ||
|
||
fn main() { | ||
mut let _x = 123; | ||
//~^ ERROR invalid variable declaration | ||
} |
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 |
---|---|---|
@@ -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 | ||
|