On single local candidate, use span label

This commit is contained in:
Esteban Küber 2020-02-18 01:35:18 -08:00
parent 5e8707f39d
commit 8993b99ae2
14 changed files with 95 additions and 59 deletions

View file

@ -1,12 +1,13 @@
error[E0599]: no method named `foo` found for reference `&dyn Foo` in the current scope
--> $DIR/issue-5153.rs:10:27
|
LL | trait Foo {
| --------- this trait defines an item `foo`
...
LL | (&5isize as &dyn Foo).foo();
| ^^^ method not found in `&dyn Foo`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `foo`, perhaps you need to implement it:
candidate #1: `Foo`
error: aborting due to previous error

View file

@ -1,13 +1,14 @@
error[E0599]: no method named `f` found for fn pointer `fn(&u8)` in the current scope
--> $DIR/issue-57362-1.rs:20:7
|
LL | trait Trait {
| ----------- this trait defines an item `f`
...
LL | a.f();
| ^ method not found in `fn(&u8)`
|
= note: `a` is a function, perhaps you wish to call it
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `f`, perhaps you need to implement it:
candidate #1: `Trait`
error: aborting due to previous error

View file

@ -1,12 +1,13 @@
error[E0599]: no function or associated item named `make_g` found for fn pointer `for<'r> fn(&'r ())` in the current scope
--> $DIR/issue-57362-2.rs:22:25
|
LL | trait X {
| ------- this trait defines an item `make_g`
...
LL | let x = <fn (&())>::make_g();
| ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `make_g`, perhaps you need to implement it:
candidate #1: `X`
error: aborting due to previous error