-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
An example: http://is.gd/GuGCDC
:4:5: 7:4 error: method `add` has an incompatible type for trait: values differ in mutability [E0053]
:4 fn add(&self, _rhs: &mut Foo) -> Foo {
:5 println!("Adding!");
:6 *self
:7 }
A better error might have a span showing just the mut (or the parameter) and a suggested correct signature. Right now I have to go look the trait up, either in the code or the docs.
fn add(&self, _rhs: &mut Foo) -> Foo {
^~~
Note: The correct signature would be
fn add(&self, _rhs: &Foo) -> Foo {
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.