Closed
Description
Code
struct Foo;
impl Drop for Foo {
fn drop(self) {}
}
Current output
error[E0053]: method `drop` has an incompatible type for trait
--> src/lib.rs:46:13
|
46 | fn drop(self) {
| ^^^^
| |
| expected `&mut Foo`, found struct `Foo`
| help: change the self-receiver type to match the trait: `self: &mut Foo`
|
= note: expected signature `fn(&mut Foo)`
found signature `fn(Foo)`
Desired output
error[E0053]: method `drop` has an incompatible type for trait
--> src/lib.rs:46:13
|
46 | fn drop(self) {
| ^^^^
| |
| expected `&mut self`, found `self`
| help: change the self-receiver type to match the trait: `&mut self`
|
= note: expected signature `fn(&mut Foo)`
found signature `fn(Foo)`
Rationale and extra context
The compiler asks to fix drop(self)
into drop(self: &mut Foo)
and then suggests to just have drop(&mut self)
. It should just straight up say Change self
to &mut self
Other cases
No response
Anything else?
No response