Fix incorrect disambiguation suggestion for associated items
This commit is contained in:
parent
a0648eab36
commit
3d08ff1c19
5 changed files with 28 additions and 20 deletions
|
|
@ -16,12 +16,12 @@ LL | const ID: i32 = 3;
|
|||
| ^^^^^^^^^^^^^^^^^^
|
||||
help: disambiguate the associated constant for candidate #1
|
||||
|
|
||||
LL | const X: i32 = Foo::ID;
|
||||
| ~~~~~
|
||||
LL | const X: i32 = <i32 as Foo>::ID;
|
||||
| ~~~~~~~~~~~~~~
|
||||
help: disambiguate the associated constant for candidate #2
|
||||
|
|
||||
LL | const X: i32 = Bar::ID;
|
||||
| ~~~~~
|
||||
LL | const X: i32 = <i32 as Bar>::ID;
|
||||
| ~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ LL | fn foo() {}
|
|||
| ^^^^^^^^
|
||||
help: disambiguate the associated function for candidate #1
|
||||
|
|
||||
LL | Trait1::foo()
|
||||
| ~~~~~~~~
|
||||
LL | <Test as Trait1>::foo()
|
||||
| ~~~~~~~~~~~~~~~~~~
|
||||
help: disambiguate the associated function for candidate #2
|
||||
|
|
||||
LL | Trait2::foo()
|
||||
| ~~~~~~~~
|
||||
LL | <Test as Trait2>::foo()
|
||||
| ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ LL | fn foo() {}
|
|||
| ^^^^^^^^
|
||||
help: disambiguate the associated function for candidate #1
|
||||
|
|
||||
LL | A::foo();
|
||||
| ~~~
|
||||
LL | <AB as A>::foo();
|
||||
| ~~~~~~~~~~~
|
||||
help: disambiguate the associated function for candidate #2
|
||||
|
|
||||
LL | B::foo();
|
||||
| ~~~
|
||||
LL | <AB as B>::foo();
|
||||
| ~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -27,16 +27,16 @@ LL | fn f9(_: usize) -> usize;
|
|||
candidate #3: `UnusedTrait`
|
||||
help: disambiguate the associated function for candidate #1
|
||||
|
|
||||
LL | u.f8(42) + CtxtFn::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~
|
||||
LL | u.f8(42) + <usize as CtxtFn>::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
help: disambiguate the associated function for candidate #2
|
||||
|
|
||||
LL | u.f8(42) + OtherTrait::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL | u.f8(42) + <usize as OtherTrait>::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
help: disambiguate the associated function for candidate #3
|
||||
|
|
||||
LL | u.f8(42) + UnusedTrait::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL | u.f8(42) + <usize as UnusedTrait>::f9(u, 342) + m.fff(42)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
|
||||
--> $DIR/issue-7575.rs:62:30
|
||||
|
|
@ -72,7 +72,7 @@ LL | fn is_str() -> bool {
|
|||
= help: items from traits can only be used if the type parameter is bounded by the trait
|
||||
help: disambiguate the associated function for the candidate
|
||||
|
|
||||
LL | ManyImplTrait::is_str(t)
|
||||
LL | <T as ManyImplTrait>::is_str(t)
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue