diff options
| author | varkor <github@varkor.com> | 2019-04-18 19:15:53 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-04-20 22:03:39 +0100 |
| commit | c93c7e4e7cd04f82ab6a076171af9c1fa7385cc1 (patch) | |
| tree | 2a568bd11cf5f086b217cea26d42aedf88edbf2e /src | |
| parent | 47a558ed7c9b129dea246cdfb35817b1035f8de9 (diff) | |
| download | rust-c93c7e4e7cd04f82ab6a076171af9c1fa7385cc1.tar.gz rust-c93c7e4e7cd04f82ab6a076171af9c1fa7385cc1.zip | |
Add test for async fn methods feature gating
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-async-await.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-async-await.stderr | 17 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-async-await.rs b/src/test/ui/feature-gates/feature-gate-async-await.rs index 7ee035644bc..f06b0b36395 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.rs +++ b/src/test/ui/feature-gates/feature-gate-async-await.rs @@ -2,6 +2,12 @@ #![feature(futures_api)] +struct S; + +impl S { + async fn foo() {} //~ ERROR async fn is unstable +} + async fn foo() {} //~ ERROR async fn is unstable fn main() { diff --git a/src/test/ui/feature-gates/feature-gate-async-await.stderr b/src/test/ui/feature-gates/feature-gate-async-await.stderr index 6bff254607f..41325638422 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.stderr +++ b/src/test/ui/feature-gates/feature-gate-async-await.stderr @@ -1,5 +1,14 @@ error[E0658]: async fn is unstable - --> $DIR/feature-gate-async-await.rs:5:1 + --> $DIR/feature-gate-async-await.rs:8:5 + | +LL | async fn foo() {} + | ^^^^^^^^^^^^^^^^^ + | + = note: for more information, see https://github.com/rust-lang/rust/issues/50547 + = help: add #![feature(async_await)] to the crate attributes to enable + +error[E0658]: async fn is unstable + --> $DIR/feature-gate-async-await.rs:11:1 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ @@ -8,7 +17,7 @@ LL | async fn foo() {} = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async blocks are unstable - --> $DIR/feature-gate-async-await.rs:8:13 + --> $DIR/feature-gate-async-await.rs:14:13 | LL | let _ = async {}; | ^^^^^^^^ @@ -17,7 +26,7 @@ LL | let _ = async {}; = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async closures are unstable - --> $DIR/feature-gate-async-await.rs:9:13 + --> $DIR/feature-gate-async-await.rs:15:13 | LL | let _ = async || {}; | ^^^^^^^^^^^ @@ -25,6 +34,6 @@ LL | let _ = async || {}; = note: for more information, see https://github.com/rust-lang/rust/issues/50547 = help: add #![feature(async_await)] to the crate attributes to enable -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0658`. |
