1
Fork 0

Sort method suggestions by DefPath instead of DefId

This commit is contained in:
Oli Scherer 2024-03-21 16:47:04 +00:00
parent 727807293b
commit 57f68c3555
8 changed files with 54 additions and 51 deletions

View file

@ -29,33 +29,33 @@ error[E0034]: multiple applicable items in scope
LL | let z = x.foo();
| ^^^ multiple `foo` found
|
note: candidate #1 is defined in an impl of the trait `X` for the type `T`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:45:9
note: candidate #1 is defined in the trait `FinalFoo`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:59:5
|
LL | fn foo(self: Smaht<Self, u64>) -> u64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | fn foo(&self) -> u8;
| ^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `NuisanceFoo` for the type `T`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:72:9
|
LL | fn foo(self) {}
| ^^^^^^^^^^^^
note: candidate #3 is defined in the trait `FinalFoo`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:59:5
note: candidate #3 is defined in an impl of the trait `X` for the type `T`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:45:9
|
LL | fn foo(&self) -> u8;
| ^^^^^^^^^^^^^^^^^^^^
LL | fn foo(self: Smaht<Self, u64>) -> u64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
|
LL | let z = X::foo(x);
| ~~~~~~~~~
LL | let z = FinalFoo::foo(&x);
| ~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
|
LL | let z = NuisanceFoo::foo(x);
| ~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #3
|
LL | let z = FinalFoo::foo(&x);
| ~~~~~~~~~~~~~~~~~
LL | let z = X::foo(x);
| ~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24