forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a compiler diagnostic for move async mistake
Ran the tidy check Following the diagnostic guide better Diagnostic generation is now relegated to its own function in the diagnostics module. Added tests Fixed the ui test
- Loading branch information
1 parent
caeb333
commit a272d62
Showing
5 changed files
with
61 additions
and
4 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
8 changes: 8 additions & 0 deletions
8
src/test/ui/parser/incorrect-move-async-order-issue-79694.fixed
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 @@ | ||
// run-rustfix | ||
// edition:2018 | ||
|
||
// Regression test for issue 79694 | ||
|
||
fn main() { | ||
let _ = async move { }; //~ ERROR 7:13: 7:23: the order of `move` and `async` is incorrect | ||
} |
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 @@ | ||
// run-rustfix | ||
// edition:2018 | ||
|
||
// Regression test for issue 79694 | ||
|
||
fn main() { | ||
let _ = move async { }; //~ ERROR 7:13: 7:23: the order of `move` and `async` is incorrect | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr
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,13 @@ | ||
error: the order of `move` and `async` is incorrect | ||
--> $DIR/incorrect-move-async-order-issue-79694.rs:7:13 | ||
| | ||
LL | let _ = move async { }; | ||
| ^^^^^^^^^^ | ||
| | ||
help: try switching the order | ||
| | ||
LL | let _ = async move { }; | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|