Commit 8a74df9
authored
Rollup merge of rust-lang#121792 - GuillaumeGomez:improve-suggestion, r=michaelwoerister
Improve renaming suggestion when item starts with underscore
Fixes rust-lang#121776.
It goes from:
```terminal
error[E0433]: failed to resolve: use of undeclared type `Foo`
--> src/foo.rs:6:13
|
6 | let _ = Foo::Bar;
| ^^^ use of undeclared type `Foo`
|
help: an enum with a similar name exists, consider changing it
|
1 | enum Foo {
| ~~~
```
to:
```terminal
error[E0433]: failed to resolve: use of undeclared type `Foo`
--> foo.rs:6:13
|
6 | let _ = Foo::Bar;
| ^^^ use of undeclared type `Foo`
|
help: an enum with a similar name exists, consider renaming `_Foo` into `Foo`
|
1 | enum Foo {
| ~~~
error: aborting due to 1 previous error
```File tree
2 files changed
+4
-3
lines changed- compiler/rustc_resolve/src
- tests/ui/suggestions
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1585 | 1585 | | |
1586 | 1586 | | |
1587 | 1587 | | |
1588 | | - | |
| 1588 | + | |
| 1589 | + | |
1589 | 1590 | | |
1590 | | - | |
| 1591 | + | |
1591 | 1592 | | |
1592 | 1593 | | |
1593 | 1594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments