summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/const-async-fn-in-main.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/async-await/const-async-fn-in-main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/async-await/const-async-fn-in-main.rs b/tests/ui/async-await/const-async-fn-in-main.rs
new file mode 100644
index 000000000..5d1aa4d83
--- /dev/null
+++ b/tests/ui/async-await/const-async-fn-in-main.rs
@@ -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`
+}