]> git.lizzy.rs Git - rust.git/commitdiff
Add test for async fn methods feature gating
authorvarkor <github@varkor.com>
Thu, 18 Apr 2019 18:15:53 +0000 (19:15 +0100)
committervarkor <github@varkor.com>
Sat, 20 Apr 2019 21:03:39 +0000 (22:03 +0100)
src/test/ui/feature-gates/feature-gate-async-await.rs
src/test/ui/feature-gates/feature-gate-async-await.stderr

index 7ee035644bc958e29b5374ab4d93e220090ce3f5..f06b0b36395036eb2442057d237a747997c765d0 100644 (file)
@@ -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() {
index 6bff254607fcafe4f2705dc3dfb7863b2e4bea4a..4132563842235a8c4f35d805e425d48a2ff4c4e4 100644 (file)
@@ -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`.