diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-02-29 14:33:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-29 14:33:53 +0100 |
| commit | 8a74df9c22f717f5ec931f979fa5cdef106f6085 (patch) | |
| tree | d2de301807b2cb00a0dd1df775977fc2cff83ca2 /tests | |
| parent | 7147112c8c2065010d315705ab5ac7a7cc10e81a (diff) | |
| parent | 451fd9815393b1b1ed8f28f27929645b31550a3f (diff) | |
| download | rust-8a74df9c22f717f5ec931f979fa5cdef106f6085.tar.gz rust-8a74df9c22f717f5ec931f979fa5cdef106f6085.zip | |
Rollup merge of #121792 - GuillaumeGomez:improve-suggestion, r=michaelwoerister
Improve renaming suggestion when item starts with underscore
Fixes https://github.com/rust-lang/rust/issues/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
```
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/suggestions/silenced-binding-typo.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/suggestions/silenced-binding-typo.stderr b/tests/ui/suggestions/silenced-binding-typo.stderr index 8dbd94208d6..c362d00c713 100644 --- a/tests/ui/suggestions/silenced-binding-typo.stderr +++ b/tests/ui/suggestions/silenced-binding-typo.stderr @@ -4,7 +4,7 @@ error[E0425]: cannot find value `x` in this scope LL | let _y = x; | ^ | -help: a local variable with a similar name exists, consider changing it +help: a local variable with a similar name exists, consider renaming `_x` into `x` | LL | let x = 42; | ~ |
