forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#89487 - FabianWolff:issue-89396, r=petroche…
…nkov Try to recover from a `=>` -> `=` or `->` typo in a match arm Fixes rust-lang#89396.
- Loading branch information
Showing
5 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Regression test for issue #89396: Try to recover from a | ||
// `=>` -> `=` or `->` typo in a match arm. | ||
|
||
// run-rustfix | ||
|
||
fn main() { | ||
let opt = Some(42); | ||
let _ = match opt { | ||
Some(_) => true, | ||
//~^ ERROR: expected one of | ||
//~| HELP: try using a fat arrow here | ||
None => false, | ||
//~^ ERROR: expected one of | ||
//~| HELP: try using a fat arrow here | ||
}; | ||
} |
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,16 @@ | ||
// Regression test for issue #89396: Try to recover from a | ||
// `=>` -> `=` or `->` typo in a match arm. | ||
|
||
// run-rustfix | ||
|
||
fn main() { | ||
let opt = Some(42); | ||
let _ = match opt { | ||
Some(_) = true, | ||
//~^ ERROR: expected one of | ||
//~| HELP: try using a fat arrow here | ||
None -> false, | ||
//~^ ERROR: expected one of | ||
//~| HELP: try using a fat arrow here | ||
}; | ||
} |
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 one of `=>`, `if`, or `|`, found `=` | ||
--> $DIR/issue-89396.rs:9:17 | ||
| | ||
LL | Some(_) = true, | ||
| ^ | ||
| | | ||
| expected one of `=>`, `if`, or `|` | ||
| help: try using a fat arrow here: `=>` | ||
|
||
error: expected one of `=>`, `@`, `if`, or `|`, found `->` | ||
--> $DIR/issue-89396.rs:12:14 | ||
| | ||
LL | None -> false, | ||
| ^^ | ||
| | | ||
| expected one of `=>`, `@`, `if`, or `|` | ||
| help: try using a fat arrow here: `=>` | ||
|
||
error: aborting due to 2 previous errors | ||
|