Closed
Description
When implementing a trait, it would be useful to see the expected method signature in compiler error messages. Example
impl std::fmt::Display for MyType {
// Not sure what to put here so I stub it and hope to get help from error
fn fmt() -> () { }
}
The current error message for E0186 only lets me partially resolve the issue:
error: method `fmt` has a `&self` declaration in the trait, but not in the impl [E0186]
It would be more friendly to the user if the message showed both the actual and expected method signatures.
Incorrect method signature for trait `Display` method `fmt`
Actual signature fn fmt() -> ()
Expected signature fn fmt(&self, &mut Formatter) -> Result<(), Error>