Rollup merge of #67127 - estebank:disambiguate-suggestion, r=varkor
Use structured suggestion for disambiguating method calls Fix #65635.
This commit is contained in:
commit
f0eb4b4752
18 changed files with 274 additions and 82 deletions
|
|
@ -2,7 +2,10 @@ error[E0034]: multiple applicable items in scope
|
|||
--> $DIR/issue-18446.rs:18:7
|
||||
|
|
||||
LL | x.foo();
|
||||
| ^^^ multiple `foo` found
|
||||
| --^^^--
|
||||
| | |
|
||||
| | multiple `foo` found
|
||||
| help: disambiguate the method call for candidate #2: `T::foo(&x)`
|
||||
|
|
||||
note: candidate #1 is defined in an impl for the type `dyn T`
|
||||
--> $DIR/issue-18446.rs:9:5
|
||||
|
|
@ -14,7 +17,6 @@ note: candidate #2 is defined in the trait `T`
|
|||
|
|
||||
LL | fn foo(&self);
|
||||
| ^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `T::foo(&x)` instead
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,19 @@ note: candidate #1 is defined in an impl of the trait `ToPrimitive` for the type
|
|||
|
|
||||
LL | fn to_int(&self) -> isize { 0 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `ToPrimitive::to_int(&self)` instead
|
||||
note: candidate #2 is defined in an impl of the trait `Add` for the type `isize`
|
||||
--> $DIR/issue-3702-2.rs:14:5
|
||||
|
|
||||
LL | fn to_int(&self) -> isize { *self }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `Add::to_int(&self)` instead
|
||||
help: disambiguate the method call for candidate #1
|
||||
|
|
||||
LL | ToPrimitive::to_int(&self) + other.to_int()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: disambiguate the method call for candidate #2
|
||||
|
|
||||
LL | Add::to_int(&self) + other.to_int()
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,19 @@ note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn
|
|||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `async::r#struct(r#fn {})` instead
|
||||
note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn`
|
||||
--> $DIR/issue-65634-raw-ident-suggestion.rs:10:5
|
||||
|
|
||||
LL | fn r#struct(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `await::r#struct(r#fn {})` instead
|
||||
help: disambiguate the method call for candidate #1
|
||||
|
|
||||
LL | async::r#struct(&r#fn {});
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: disambiguate the method call for candidate #2
|
||||
|
|
||||
LL | await::r#struct(&r#fn {});
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue