2024-08-22 00:55:09 +00:00
error[E0307]: invalid `self` parameter type: `&dyn Foo`
--> $DIR/inference_var_self_argument.rs:5:24
|
LL | async fn foo(self: &dyn Foo) {
| ^^^^^^^^
|
2024-12-13 15:40:37 +00:00
= note: type of `self` must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
2024-08-22 00:55:09 +00:00
2024-11-20 22:19:36 +00:00
error[E0038]: the trait `Foo` is not dyn compatible
2024-01-17 14:52:38 +00:00
--> $DIR/inference_var_self_argument.rs:5:5
|
LL | async fn foo(self: &dyn Foo) {
2024-11-20 22:19:36 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo` is not dyn compatible
2024-01-17 14:52:38 +00:00
|
2024-11-20 22:19:36 +00:00
note: for a trait to be dyn compatible it needs to allow building a vtable
2025-01-22 04:14:07 +00:00
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
2024-01-17 14:52:38 +00:00
--> $DIR/inference_var_self_argument.rs:5:14
|
LL | trait Foo {
2024-11-20 22:19:36 +00:00
| --- this trait is not dyn compatible...
2024-01-17 14:52:38 +00:00
LL | async fn foo(self: &dyn Foo) {
| ^^^ ...because method `foo` is `async`
= help: consider moving `foo` to another trait
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0038, E0307.
For more information about an error, try `rustc --explain E0038`.