Do not suggest similarly named enclosing item

This commit is contained in:
Esteban Küber 2020-08-09 21:02:58 -07:00
parent eef284be59
commit 089810a1cb
8 changed files with 46 additions and 59 deletions

View file

@ -2,10 +2,7 @@ error[E0573]: expected type, found const parameter `C`
--> $DIR/struct-with-invalid-const-param.rs:4:23
|
LL | struct S<const C: u8>(C);
| ----------------------^--
| | |
| | help: a struct with a similar name exists: `S`
| similarly named struct `S` defined here
| ^ not a type
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/struct-with-invalid-const-param.rs:1:12

View file

@ -1,10 +1,8 @@
error[E0425]: cannot find function `g` in this scope
--> $DIR/issue-31845.rs:7:12
|
LL | fn h() {
| ------ similarly named function `h` defined here
LL | g();
| ^ help: a function with a similar name exists: `h`
| ^ not found in this scope
error: aborting due to previous error

View file

@ -5,16 +5,7 @@ LL | struct X {}
| ----------- `X` defined here
LL |
LL | const Y: X = X("ö");
| -------------^^^^^^- similarly named constant `Y` defined here
|
help: use struct literal syntax instead
|
LL | const Y: X = X {};
| ^^^^
help: a constant with a similar name exists
|
LL | const Y: X = Y("ö");
| ^
| ^^^^^^ help: use struct literal syntax instead: `X {}`
error: aborting due to previous error

View file

@ -1,10 +1,8 @@
error[E0423]: expected function, tuple struct or tuple variant, found struct `S`
--> $DIR/legacy-ctor-visibility.rs:9:13
|
LL | fn f() {
| ------ similarly named function `f` defined here
LL | S(10);
| ^ help: a function with a similar name exists: `f`
| ^
error: aborting due to previous error

View file

@ -44,12 +44,8 @@ error[E0412]: cannot find type `Y` in this scope
--> $DIR/attributes-on-modules-fail.rs:10:14
|
LL | type A = Y;
| ---------^- similarly named type alias `A` defined here
| ^ not found in this scope
|
help: a type alias with a similar name exists
|
LL | type A = A;
| ^
help: consider importing this struct
|
LL | use Y;
@ -59,12 +55,8 @@ error[E0412]: cannot find type `X` in this scope
--> $DIR/attributes-on-modules-fail.rs:14:10
|
LL | type A = X;
| ---------^- similarly named type alias `A` defined here
| ^ not found in this scope
|
help: a type alias with a similar name exists
|
LL | type A = A;
| ^
help: consider importing this struct
|
LL | use m::X;

View file

@ -16,9 +16,6 @@ LL | m::Z::Unit;
error[E0423]: expected value, found enum `Z`
--> $DIR/privacy-enum-ctor.rs:25:9
|
LL | fn f() {
| ------ similarly named function `f` defined here
...
LL | Z;
| ^
|
@ -30,10 +27,6 @@ LL | m::Z::Struct;
| ^^^^^^^^^^^^
LL | m::Z::Unit;
| ^^^^^^^^^^
help: a function with a similar name exists
|
LL | f;
| ^
error[E0423]: expected value, found struct variant `Z::Struct`
--> $DIR/privacy-enum-ctor.rs:29:20

View file

@ -2,10 +2,7 @@ error[E0412]: cannot find type `B` in this scope
--> $DIR/ui-testing-optout.rs:4:10
|
4 | type A = B;
| ---------^-
| | |
| | help: a type alias with a similar name exists: `A`
| similarly named type alias `A` defined here
| ^ not found in this scope
error[E0412]: cannot find type `D` in this scope
--> $DIR/ui-testing-optout.rs:7:10