rust/compiler/rustc_resolve/src
Guillaume Gomez 8a74df9c22
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
```
2024-02-29 14:33:53 +01:00
..
diagnostics Implement the unused_macro_rules lint 2022-05-05 19:13:00 +02:00
late Rename DiagnosticBuilder as Diag. 2024-02-28 08:55:35 +11:00
build_reduced_graph.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
check_unused.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
def_collector.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
diagnostics.rs Rollup merge of #121792 - GuillaumeGomez:improve-suggestion, r=michaelwoerister 2024-02-29 14:33:53 +01:00
effective_visibilities.rs Delegation implementation: step 1 2024-01-12 14:11:16 +03:00
errors.rs Remove unused diagnostic struct 2024-02-29 14:14:21 +08:00
ident.rs Remove an unnecessary span_delayed_bug in Resolver::valid_res_from_ribs. 2024-02-27 16:31:40 +11:00
imports.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
late.rs Rename DiagnosticArg{,Map,Name,Value} as DiagArg{,Map,Name,Value}. 2024-02-28 08:55:37 +11:00
lib.rs Rename DiagnosticBuilder as Diag. 2024-02-28 08:55:35 +11:00
macros.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
rustdoc.rs NFC don't convert types to identical types 2023-12-15 23:56:24 +01:00