forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// edition:2021 | ||
// Check what happens when a const async fn is in the main function (#102796) | ||
|
||
fn main() { | ||
const async fn a() {} | ||
//~^ ERROR functions cannot be both `const` and `async` | ||
} |
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 @@ | ||
error: functions cannot be both `const` and `async` | ||
--> $DIR/const-async-fn-in-main.rs:5:5 | ||
| | ||
LL | const async fn a() {} | ||
| ^^^^^-^^^^^---------- | ||
| | | | ||
| | `async` because of this | ||
| `const` because of this | ||
|
||
error: aborting due to previous error | ||
|