Fix some totally useless suggestions

This commit is contained in:
Michael Goulet 2022-12-27 07:17:22 +00:00
parent d2404d6dca
commit 050bc95ce2
3 changed files with 3 additions and 13 deletions

View File

@ -896,7 +896,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
let resolutions = resolutions.as_ref().into_iter().flat_map(|r| r.iter());
let names = resolutions
.filter_map(|(BindingKey { ident: i, .. }, resolution)| {
if *i == ident {
if i.name == ident.name {
return None;
} // Never suggest the same name
match *resolution.borrow() {

View File

@ -2,10 +2,7 @@ error[E0432]: unresolved import `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:20:9
|
LL | use my_core;
| ^^^^^^^
| |
| no `my_core` in the root
| help: a similar name exists in the module: `my_core`
| ^^^^^^^ no `my_core` in the root
error[E0432]: unresolved import `my_core`
--> $DIR/extern-prelude-from-opaque-fail.rs:7:13

View File

@ -2,10 +2,7 @@ error[E0432]: unresolved import `main`
--> $DIR/inaccessible-test-modules.rs:5:5
|
LL | use main as x;
| ----^^^^^
| |
| no `main` in the root
| help: a similar name exists in the module: `main`
| ^^^^^^^^^ no `main` in the root
error[E0432]: unresolved import `test`
--> $DIR/inaccessible-test-modules.rs:6:5
@ -13,10 +10,6 @@ error[E0432]: unresolved import `test`
LL | use test as y;
| ^^^^^^^^^ no `test` in the root
|
help: a similar name exists in the module
|
LL | use test as y;
| ~~~~
help: consider importing this module instead
|
LL | use test::test as y;