Skip to content

Commit b6888db

Browse files
committed
Add test for async fn methods feature gating
1 parent db13fe6 commit b6888db

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/test/ui/feature-gates/feature-gate-async-await.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
#![feature(futures_api)]
44

5+
struct S;
6+
7+
impl S {
8+
async fn foo() {} //~ ERROR async fn is unstable
9+
}
10+
511
async fn foo() {} //~ ERROR async fn is unstable
612

713
fn main() {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
error[E0658]: async fn is unstable
2-
--> $DIR/feature-gate-async-await.rs:5:1
2+
--> $DIR/feature-gate-async-await.rs:8:5
3+
|
4+
LL | async fn foo() {}
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
8+
= help: add #![feature(async_await)] to the crate attributes to enable
9+
10+
error[E0658]: async fn is unstable
11+
--> $DIR/feature-gate-async-await.rs:11:1
312
|
413
LL | async fn foo() {}
514
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +17,7 @@ LL | async fn foo() {}
817
= help: add #![feature(async_await)] to the crate attributes to enable
918

1019
error[E0658]: async blocks are unstable
11-
--> $DIR/feature-gate-async-await.rs:8:13
20+
--> $DIR/feature-gate-async-await.rs:14:13
1221
|
1322
LL | let _ = async {};
1423
| ^^^^^^^^
@@ -17,14 +26,14 @@ LL | let _ = async {};
1726
= help: add #![feature(async_await)] to the crate attributes to enable
1827

1928
error[E0658]: async closures are unstable
20-
--> $DIR/feature-gate-async-await.rs:9:13
29+
--> $DIR/feature-gate-async-await.rs:15:13
2130
|
2231
LL | let _ = async || {};
2332
| ^^^^^^^^^^^
2433
|
2534
= note: for more information, see https://github.com/rust-lang/rust/issues/50547
2635
= help: add #![feature(async_await)] to the crate attributes to enable
2736

28-
error: aborting due to 3 previous errors
37+
error: aborting due to 4 previous errors
2938

3039
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)