about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/feature-gates/feature-gate-async-await.rs6
-rw-r--r--src/test/ui/feature-gates/feature-gate-async-await.stderr17
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`.