Add test for async fn methods feature gating
This commit is contained in:
parent
47a558ed7c
commit
c93c7e4e7c
2 changed files with 19 additions and 4 deletions
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
#![feature(futures_api)]
|
#![feature(futures_api)]
|
||||||
|
|
||||||
|
struct S;
|
||||||
|
|
||||||
|
impl S {
|
||||||
|
async fn foo() {} //~ ERROR async fn is unstable
|
||||||
|
}
|
||||||
|
|
||||||
async fn foo() {} //~ ERROR async fn is unstable
|
async fn foo() {} //~ ERROR async fn is unstable
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
error[E0658]: async fn is unstable
|
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() {}
|
LL | async fn foo() {}
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
@ -8,7 +17,7 @@ LL | async fn foo() {}
|
||||||
= help: add #![feature(async_await)] to the crate attributes to enable
|
= help: add #![feature(async_await)] to the crate attributes to enable
|
||||||
|
|
||||||
error[E0658]: async blocks are unstable
|
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 {};
|
LL | let _ = async {};
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^
|
||||||
|
@ -17,7 +26,7 @@ LL | let _ = async {};
|
||||||
= help: add #![feature(async_await)] to the crate attributes to enable
|
= help: add #![feature(async_await)] to the crate attributes to enable
|
||||||
|
|
||||||
error[E0658]: async closures are unstable
|
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 || {};
|
LL | let _ = async || {};
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
@ -25,6 +34,6 @@ LL | let _ = async || {};
|
||||||
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
|
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
|
||||||
= help: add #![feature(async_await)] to the crate attributes to enable
|
= 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`.
|
For more information about this error, try `rustc --explain E0658`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue