diff options
Diffstat (limited to 'tests/ui/async-await/async-fn')
| -rw-r--r-- | tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs | 1 | ||||
| -rw-r--r-- | tests/ui/async-await/async-fn/edition-2015.rs | 1 | ||||
| -rw-r--r-- | tests/ui/async-await/async-fn/edition-2015.stderr | 8 |
3 files changed, 6 insertions, 4 deletions
diff --git a/tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs b/tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs index d222ddc081e..60a7dff7d49 100644 --- a/tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs +++ b/tests/ui/async-await/async-fn/edition-2015-not-async-bound.rs @@ -1,3 +1,4 @@ +//@ edition:2015 //@ check-pass // Make sure that we don't eagerly recover `async ::Bound` in edition 2015. diff --git a/tests/ui/async-await/async-fn/edition-2015.rs b/tests/ui/async-await/async-fn/edition-2015.rs index 341b9b10e67..5a81df3a4e4 100644 --- a/tests/ui/async-await/async-fn/edition-2015.rs +++ b/tests/ui/async-await/async-fn/edition-2015.rs @@ -1,3 +1,4 @@ +//@ edition:2015 fn foo(x: impl async Fn()) -> impl async Fn() { x } //~^ ERROR `async` trait bounds are only allowed in Rust 2018 or later //~| ERROR `async` trait bounds are only allowed in Rust 2018 or later diff --git a/tests/ui/async-await/async-fn/edition-2015.stderr b/tests/ui/async-await/async-fn/edition-2015.stderr index ca9e64cd1bb..0bec00c162c 100644 --- a/tests/ui/async-await/async-fn/edition-2015.stderr +++ b/tests/ui/async-await/async-fn/edition-2015.stderr @@ -1,5 +1,5 @@ error: `async` trait bounds are only allowed in Rust 2018 or later - --> $DIR/edition-2015.rs:1:16 + --> $DIR/edition-2015.rs:2:16 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ @@ -8,7 +8,7 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } = note: for more on editions, read https://doc.rust-lang.org/edition-guide error: `async` trait bounds are only allowed in Rust 2018 or later - --> $DIR/edition-2015.rs:1:36 + --> $DIR/edition-2015.rs:2:36 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ @@ -17,7 +17,7 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0658]: `async` trait bounds are unstable - --> $DIR/edition-2015.rs:1:16 + --> $DIR/edition-2015.rs:2:16 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ @@ -28,7 +28,7 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } = help: use the desugared name of the async trait, such as `AsyncFn` error[E0658]: `async` trait bounds are unstable - --> $DIR/edition-2015.rs:1:36 + --> $DIR/edition-2015.rs:2:36 | LL | fn foo(x: impl async Fn()) -> impl async Fn() { x } | ^^^^^ |
