File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 22trait T {
33 async fn foo ( ) { } //~ ERROR functions in traits cannot be declared `async`
44 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+ }
59}
610
711fn main ( ) { }
Original file line number Diff line number Diff line change @@ -20,6 +20,22 @@ LL | async fn bar(&self) {}
2020 = note: `async` trait functions are not currently supported
2121 = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
2222
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
2440
2541For more information about this error, try `rustc --explain E0706`.
You can’t perform that action at this time.
0 commit comments