Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f8e3947

Browse files
authored
Unrolled build for rust-lang#116178
Rollup merge of rust-lang#116178 - Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser Add test for `const async fn` This adds a test for rust-lang#102796
2 parents 376f3f0 + 35f9345 commit f8e3947

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// edition:2021
2+
// Check what happens when a const async fn is in the main function (#102796)
3+
4+
fn main() {
5+
const async fn a() {}
6+
//~^ ERROR functions cannot be both `const` and `async`
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: functions cannot be both `const` and `async`
2+
--> $DIR/const-async-fn-in-main.rs:5:5
3+
|
4+
LL | const async fn a() {}
5+
| ^^^^^-^^^^^----------
6+
| | |
7+
| | `async` because of this
8+
| `const` because of this
9+
10+
error: aborting due to previous error
11+

0 commit comments

Comments
 (0)