Suggest similarly named assoc items in trait impls

Previously, the compiler didn't suggest similarly named associated items
unlike we do in many situations. This patch adds such diagnostics for
associated functions, types and constants.
This commit is contained in:
Hirochika Matsumoto 2021-09-26 00:53:37 +09:00
parent 60fe8b3a65
commit cef736f8a0
8 changed files with 216 additions and 18 deletions

View file

@ -2,7 +2,10 @@ error[E0407]: method `b` is not a member of trait `Foo`
--> $DIR/E0407.rs:9:5
|
LL | fn b() {}
| ^^^^^^^^^ not a member of trait `Foo`
| ^^^-^^^^^
| | |
| | help: there is an associated function with a similar name: `a`
| not a member of trait `Foo`
error: aborting due to previous error