Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkov
Use def span for associated function suggestions
This commit is contained in:
commit
2770fdfaaa
3 changed files with 13 additions and 16 deletions
|
|
@ -8,13 +8,13 @@ note: candidate #1 is defined in the trait `A`
|
|||
--> $DIR/issue-37767.rs:12:5
|
||||
|
|
||||
12 | fn foo(&mut self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `A::foo(&a)` instead
|
||||
note: candidate #2 is defined in the trait `B`
|
||||
--> $DIR/issue-37767.rs:16:5
|
||||
|
|
||||
16 | fn foo(&mut self) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `B::foo(&a)` instead
|
||||
|
||||
error[E0034]: multiple applicable items in scope
|
||||
|
|
@ -27,13 +27,13 @@ note: candidate #1 is defined in the trait `C`
|
|||
--> $DIR/issue-37767.rs:24:5
|
||||
|
|
||||
24 | fn foo(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `C::foo(&a)` instead
|
||||
note: candidate #2 is defined in the trait `D`
|
||||
--> $DIR/issue-37767.rs:28:5
|
||||
|
|
||||
28 | fn foo(&self) {}
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `D::foo(&a)` instead
|
||||
|
||||
error[E0034]: multiple applicable items in scope
|
||||
|
|
@ -46,13 +46,13 @@ note: candidate #1 is defined in the trait `E`
|
|||
--> $DIR/issue-37767.rs:36:5
|
||||
|
|
||||
36 | fn foo(self) {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `E::foo(a)` instead
|
||||
note: candidate #2 is defined in the trait `F`
|
||||
--> $DIR/issue-37767.rs:40:5
|
||||
|
|
||||
40 | fn foo(self) {}
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `F::foo(a)` instead
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
|
|
|||
|
|
@ -44,10 +44,8 @@ error[E0599]: no method named `fff` found for type `Myisize` in the current scop
|
|||
note: candidate #1 is defined in an impl for the type `Myisize`
|
||||
--> $DIR/issue-7575.rs:51:5
|
||||
|
|
||||
51 | / fn fff(i: isize) -> isize {
|
||||
52 | | i
|
||||
53 | | }
|
||||
| |_____^
|
||||
51 | fn fff(i: isize) -> isize {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0599]: no method named `is_str` found for type `T` in the current scope
|
||||
--> $DIR/issue-7575.rs:82:7
|
||||
|
|
@ -60,10 +58,8 @@ error[E0599]: no method named `is_str` found for type `T` in the current scope
|
|||
note: candidate #1 is defined in the trait `ManyImplTrait`
|
||||
--> $DIR/issue-7575.rs:57:5
|
||||
|
|
||||
57 | / fn is_str() -> bool {
|
||||
58 | | false
|
||||
59 | | }
|
||||
| |_____^
|
||||
57 | fn is_str() -> bool {
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
= help: to disambiguate the method call, write `ManyImplTrait::is_str(t)` instead
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
= note: the following trait defines an item `is_str`, perhaps you need to implement it:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue