File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ pub trait Trait {
2+ async fn method ( & self ) ;
3+ }
4+
5+ pub struct Struct ;
6+
7+ impl Trait for Struct {
8+ async fn method ( & self ) { }
9+ }
10+
11+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0706]: functions in traits cannot be declared `async`
2+ --> tests/ui/no-attribute-macro.rs:2:5
3+ |
4+ 2 | async fn method(&self);
5+ | -----^^^^^^^^^^^^^^^^^^
6+ | |
7+ | `async` because of this
8+ |
9+ = note: `async` trait functions are not currently supported
10+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
11+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
12+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
13+
14+ error[E0706]: functions in traits cannot be declared `async`
15+ --> tests/ui/no-attribute-macro.rs:8:5
16+ |
17+ 8 | async fn method(&self) {}
18+ | -----^^^^^^^^^^^^^^^^^
19+ | |
20+ | `async` because of this
21+ |
22+ = note: `async` trait functions are not currently supported
23+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
24+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
25+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
You can’t perform that action at this time.
0 commit comments