-
Couldn't load subscription status.
- Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
Given
trait Foo {
fn bar(&mut self, other: &mut Foo);
}
struct Baz;
impl Foo for Baz {
fn bar(&mut self, other: &Foo) {}
}
the current output is
error[E0053]: method `bar` has an incompatible type for trait
--> $DIR/issue-13033.rs:18:30
|
LL | fn bar(&mut self, other: &mut Foo);
| -------- type in trait
...
LL | fn bar(&mut self, other: &Foo) {}
| ^^^^ types differ in mutability
|
= note: expected type `fn(&mut Baz, &mut dyn Foo)`
found type `fn(&mut Baz, &dyn Foo)`
It should suggest to change the impl method signature to match the trait.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints