diff options
| author | varkor <github@varkor.com> | 2019-04-18 20:57:15 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-04-20 22:03:39 +0100 |
| commit | 98c71c36d693c5643309baaa06eea70015c01029 (patch) | |
| tree | 02d55ccd6b3ca7f22796fb199e20820fc0bddf5e /src/test | |
| parent | 93c4b1f49154325d4b0220c9961aa79be8020d7a (diff) | |
| download | rust-98c71c36d693c5643309baaa06eea70015c01029.tar.gz rust-98c71c36d693c5643309baaa06eea70015c01029.zip | |
Check async in trait methods
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-async-await.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-async-await.stderr | 26 |
2 files changed, 26 insertions, 5 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 f06b0b36395..1fdaec75e9d 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.rs +++ b/src/test/ui/feature-gates/feature-gate-async-await.rs @@ -8,6 +8,11 @@ impl S { async fn foo() {} //~ ERROR async fn is unstable } +trait T { + async fn foo(); //~ ERROR trait fns cannot be declared `async` + //~^ 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 41325638422..3f6731f47df 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.stderr +++ b/src/test/ui/feature-gates/feature-gate-async-await.stderr @@ -1,3 +1,9 @@ +error[E0706]: trait fns cannot be declared `async` + --> $DIR/feature-gate-async-await.rs:12:5 + | +LL | async fn foo(); + | ^^^^^^^^^^^^^^^ + error[E0658]: async fn is unstable --> $DIR/feature-gate-async-await.rs:8:5 | @@ -8,7 +14,16 @@ LL | async fn foo() {} = 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 + --> $DIR/feature-gate-async-await.rs:12: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:16:1 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ @@ -17,7 +32,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:14:13 + --> $DIR/feature-gate-async-await.rs:19:13 | LL | let _ = async {}; | ^^^^^^^^ @@ -26,7 +41,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:15:13 + --> $DIR/feature-gate-async-await.rs:20:13 | LL | let _ = async || {}; | ^^^^^^^^^^^ @@ -34,6 +49,7 @@ 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 4 previous errors +error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors occurred: E0658, E0706. +For more information about an error, try `rustc --explain E0658`. |
