mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
add test
fix tidy remove dir
This commit is contained in:
parent
6710e3312d
commit
35f9345076
7
tests/ui/async-await/const-async-fn-in-main.rs
Normal file
7
tests/ui/async-await/const-async-fn-in-main.rs
Normal file
@ -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`
|
||||
}
|
11
tests/ui/async-await/const-async-fn-in-main.stderr
Normal file
11
tests/ui/async-await/const-async-fn-in-main.stderr
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user