Skip to content

Commit 050bc95

Browse files
Fix some totally useless suggestions
1 parent d2404d6 commit 050bc95

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

compiler/rustc_resolve/src/imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
896896
let resolutions = resolutions.as_ref().into_iter().flat_map(|r| r.iter());
897897
let names = resolutions
898898
.filter_map(|(BindingKey { ident: i, .. }, resolution)| {
899-
if *i == ident {
899+
if i.name == ident.name {
900900
return None;
901901
} // Never suggest the same name
902902
match *resolution.borrow() {

src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ error[E0432]: unresolved import `my_core`
22
--> $DIR/extern-prelude-from-opaque-fail.rs:20:9
33
|
44
LL | use my_core;
5-
| ^^^^^^^
6-
| |
7-
| no `my_core` in the root
8-
| help: a similar name exists in the module: `my_core`
5+
| ^^^^^^^ no `my_core` in the root
96

107
error[E0432]: unresolved import `my_core`
118
--> $DIR/extern-prelude-from-opaque-fail.rs:7:13

src/test/ui/test-attrs/inaccessible-test-modules.stderr

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@ error[E0432]: unresolved import `main`
22
--> $DIR/inaccessible-test-modules.rs:5:5
33
|
44
LL | use main as x;
5-
| ----^^^^^
6-
| |
7-
| no `main` in the root
8-
| help: a similar name exists in the module: `main`
5+
| ^^^^^^^^^ no `main` in the root
96

107
error[E0432]: unresolved import `test`
118
--> $DIR/inaccessible-test-modules.rs:6:5
129
|
1310
LL | use test as y;
1411
| ^^^^^^^^^ no `test` in the root
1512
|
16-
help: a similar name exists in the module
17-
|
18-
LL | use test as y;
19-
| ~~~~
2013
help: consider importing this module instead
2114
|
2215
LL | use test::test as y;

0 commit comments

Comments
 (0)