@@ -2,40 +2,89 @@ error[E0706]: functions in traits cannot be declared `async`
22 --> $DIR/async-trait-fn.rs:3:5
33 |
44LL | async fn foo() {}
5- | -----^^^^^^^^^^^^
5+ | -----^^^^^^^^^
66 | |
77 | `async` because of this
88 |
99 = note: `async` trait functions are not currently supported
1010 = 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(return_position_impl_trait_in_trait)]` to the crate attributes to enable
1113
1214error[E0706]: functions in traits cannot be declared `async`
13- --> $DIR/async-trait-fn.rs:4 :5
15+ --> $DIR/async-trait-fn.rs:5 :5
1416 |
1517LL | async fn bar(&self) {}
16- | -----^^^^^^^^^^^^^^^^^
18+ | -----^^^^^^^^^^^^^^
1719 | |
1820 | `async` because of this
1921 |
2022 = note: `async` trait functions are not currently supported
2123 = 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(return_position_impl_trait_in_trait)]` to the crate attributes to enable
2226
2327error[E0706]: functions in traits cannot be declared `async`
24- --> $DIR/async-trait-fn.rs:5:5
28+ --> $DIR/async-trait-fn.rs:7:5
29+ |
30+ LL | async fn baz() {
31+ | -----^^^^^^^^^
32+ | |
33+ | `async` because of this
34+ |
35+ = note: `async` trait functions are not currently supported
36+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
37+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
38+ = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
39+
40+ error[E0308]: mismatched types
41+ --> $DIR/async-trait-fn.rs:3:20
42+ |
43+ LL | async fn foo() {}
44+ | ^^ expected associated type, found opaque type
45+ |
46+ ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
47+ |
48+ LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
49+ | ------------------------------- the found opaque type
50+ |
51+ = note: expected associated type `<Self as T>::foo::{opaque#0}`
52+ found opaque type `impl Future<Output = ()>`
53+
54+ error[E0308]: mismatched types
55+ --> $DIR/async-trait-fn.rs:5:25
56+ |
57+ LL | async fn bar(&self) {}
58+ | ^^ expected associated type, found opaque type
59+ |
60+ ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
61+ |
62+ LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
63+ | ------------------------------- the found opaque type
64+ |
65+ = note: expected associated type `<Self as T>::bar::{opaque#0}`
66+ found opaque type `impl Future<Output = ()>`
67+
68+ error[E0308]: mismatched types
69+ --> $DIR/async-trait-fn.rs:7:20
2570 |
2671LL | async fn baz() {
27- | ^----
28- | |
29- | _____`async` because of this
30- | |
72+ | ____________________^
73+ LL | |
3174LL | | // Nested item must not ICE.
3275LL | | fn a() {}
3376LL | | }
34- | |_____^
77+ | |_____^ expected associated type, found opaque type
3578 |
36- = note: `async` trait functions are not currently supported
37- = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
79+ ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
80+ |
81+ LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
82+ | ------------------------------- the found opaque type
83+ |
84+ = note: expected associated type `<Self as T>::baz::{opaque#0}`
85+ found opaque type `impl Future<Output = ()>`
3886
39- error: aborting due to 3 previous errors
87+ error: aborting due to 6 previous errors
4088
41- For more information about this error, try `rustc --explain E0706`.
89+ Some errors have detailed explanations: E0308, E0706.
90+ For more information about an error, try `rustc --explain E0308`.
0 commit comments