diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-15 21:41:40 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-15 21:41:45 +0200 |
| commit | a54d5759b67d79eb060dca46e851ff01a5cb9801 (patch) | |
| tree | 27dcbb668a96e7126db4667f8c89341e65aa3a51 | |
| parent | 22f6448bed394c65e356ee4132d2d1cc7234078e (diff) | |
| download | rust-a54d5759b67d79eb060dca46e851ff01a5cb9801.tar.gz rust-a54d5759b67d79eb060dca46e851ff01a5cb9801.zip | |
Add test.
| -rw-r--r-- | src/test/ui/async-await/async-trait-fn.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/async-await/async-trait-fn.stderr | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/test/ui/async-await/async-trait-fn.rs b/src/test/ui/async-await/async-trait-fn.rs index f0403b76620..e2062e82725 100644 --- a/src/test/ui/async-await/async-trait-fn.rs +++ b/src/test/ui/async-await/async-trait-fn.rs @@ -2,6 +2,10 @@ trait T { async fn foo() {} //~ ERROR functions in traits cannot be declared `async` async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async` + async fn baz() { //~ ERROR functions in traits cannot be declared `async` + // Nested item must not ICE. + fn a() {} + } } fn main() {} diff --git a/src/test/ui/async-await/async-trait-fn.stderr b/src/test/ui/async-await/async-trait-fn.stderr index 6080b2815ee..1eb8969a80d 100644 --- a/src/test/ui/async-await/async-trait-fn.stderr +++ b/src/test/ui/async-await/async-trait-fn.stderr @@ -20,6 +20,22 @@ LL | async fn bar(&self) {} = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait -error: aborting due to 2 previous errors +error[E0706]: functions in traits cannot be declared `async` + --> $DIR/async-trait-fn.rs:5:5 + | +LL | async fn baz() { + | ^---- + | | + | _____`async` because of this + | | +LL | | // Nested item must not ICE. +LL | | fn a() {} +LL | | } + | |_____^ + | + = note: `async` trait functions are not currently supported + = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0706`. |
