File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 2
2
trait T {
3
3
async fn foo ( ) { } //~ ERROR functions in traits cannot be declared `async`
4
4
async fn bar ( & self ) { } //~ ERROR functions in traits cannot be declared `async`
5
+ async fn baz ( ) { //~ ERROR functions in traits cannot be declared `async`
6
+ // Nested item must not ICE.
7
+ fn a ( ) { }
8
+ }
5
9
}
6
10
7
11
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -20,6 +20,22 @@ LL | async fn bar(&self) {}
20
20
= note: `async` trait functions are not currently supported
21
21
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
22
22
23
- error: aborting due to 2 previous errors
23
+ error[E0706]: functions in traits cannot be declared `async`
24
+ --> $DIR/async-trait-fn.rs:5:5
25
+ |
26
+ LL | async fn baz() {
27
+ | ^----
28
+ | |
29
+ | _____`async` because of this
30
+ | |
31
+ LL | | // Nested item must not ICE.
32
+ LL | | fn a() {}
33
+ LL | | }
34
+ | |_____^
35
+ |
36
+ = note: `async` trait functions are not currently supported
37
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
38
+
39
+ error: aborting due to 3 previous errors
24
40
25
41
For more information about this error, try `rustc --explain E0706`.
You can’t perform that action at this time.
0 commit comments