-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest removing unnecessary prefix let in patterns
- Loading branch information
1 parent
8c6ce6b
commit 91674cc
Showing
6 changed files
with
74 additions
and
1 deletion.
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
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
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,11 @@ | ||
fn main() { | ||
for let x of [1, 2, 3] {} | ||
//~^ ERROR expected pattern, found `let` | ||
//~| ERROR missing `in` in `for` loop | ||
|
||
match 1 { | ||
let 1 => {} | ||
//~^ ERROR expected pattern, found `let` | ||
_ => {} | ||
} | ||
} |
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,20 @@ | ||
error: expected pattern, found `let` | ||
--> $DIR/unnecessary-let.rs:2:9 | ||
| | ||
LL | for let x of [1, 2, 3] {} | ||
| ^^^ help: remove the unnecessary `let` keyword | ||
|
||
error: missing `in` in `for` loop | ||
--> $DIR/unnecessary-let.rs:2:15 | ||
| | ||
LL | for let x of [1, 2, 3] {} | ||
| ^^ help: try using `in` here instead | ||
|
||
error: expected pattern, found `let` | ||
--> $DIR/unnecessary-let.rs:7:9 | ||
| | ||
LL | let 1 => {} | ||
| ^^^ help: remove the unnecessary `let` keyword | ||
|
||
error: aborting due to 3 previous errors | ||
|