-
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
Code
trait A {
fn foo(&self);
}
trait B {
fn foo(&self);
}
struct S;
impl A for S {
fn foo(&self) {}
}
impl B for S {
fn foo(&self) {}
}
fn main() {
let s = S;
S::foo(&s);
}
Current output
help: disambiguate the method for candidate #1
|
21 | <&S as A>::foo(&s);
| ~~~~~~~~~~~
Desired output
help: disambiguate the method for candidate #1
|
21 | <S as A>::foo(&s);
| ~~~~~~~~~~~
Rationale and extra context
Current output has an extra &
in the suggested fix that fails compilation.
Other cases
No response
Anything else?
No response
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.