We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 50417a5 + 35f9345 commit 243ce35Copy full SHA for 243ce35
tests/ui/async-await/const-async-fn-in-main.rs
@@ -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
+}
tests/ui/async-await/const-async-fn-in-main.stderr
@@ -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
8
+ | `const` because of this
9
10
+error: aborting due to previous error
11
0 commit comments