]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-async-await.rs
1fdaec75e9d5ab8113564c274cc5d1360ae92f61
[rust.git] / src / test / ui / feature-gates / feature-gate-async-await.rs
1 // edition:2018
2
3 #![feature(futures_api)]
4
5 struct S;
6
7 impl S {
8     async fn foo() {} //~ ERROR async fn is unstable
9 }
10
11 trait T {
12     async fn foo(); //~ ERROR trait fns cannot be declared `async`
13     //~^ ERROR async fn is unstable
14 }
15
16 async fn foo() {} //~ ERROR async fn is unstable
17
18 fn main() {
19     let _ = async {}; //~ ERROR async blocks are unstable
20     let _ = async || {}; //~ ERROR async closures are unstable
21 }