Given this
trait FooTrait {
fn foo(&self, i32) {}
}
struct Foo;
impl FooTrait for Foo {
fn foo(&self, bar: &FooTrait) {}
}
The full error message is
error[E0053]: method `foo` has an incompatible type for trait
--> src/main.rs:8:24
|
2 | fn foo(&self, i32) {}
| --- type in trait
...
8 | fn foo(&self, bar: &FooTrait) {}
| ^^^^^^^^^ expected i32, found &FooTrait
|
= note: expected type `fn(&Foo, i32)`
found type `fn(&Foo, &FooTrait)`
which is nice. However, when using &impl FooTrait instead of &FooTrait for bar in the impl FooTrait for Foo, the full error message degenerates to
Compiling playground v0.0.1 (file:///playground)
error[E0049]: method `foo` has 1 type parameter but its trait declaration has 0 type parameters
error: aborting due to previous error
For more information about this error, try `rustc --explain E0049`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Which is almost completely useless, there aren't even line numbers...
Playground link
Given this
The full error message is
which is nice. However, when using
&impl FooTraitinstead of&FooTraitforbarin theimpl FooTrait for Foo, the full error message degenerates toWhich is almost completely useless, there aren't even line numbers...
Playground link