Do not issue E0071 if a type error has already been reported
This commit is contained in:
parent
c7dbe7a830
commit
ab83d501a4
4 changed files with 54 additions and 18 deletions
14
src/test/ui/typeck/issue-88844.rs
Normal file
14
src/test/ui/typeck/issue-88844.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Regression test for #88844.
|
||||
|
||||
struct Struct { value: i32 }
|
||||
//~^ NOTE: similarly named struct `Struct` defined here
|
||||
|
||||
impl Stuct {
|
||||
//~^ ERROR: cannot find type `Stuct` in this scope [E0412]
|
||||
//~| HELP: a struct with a similar name exists
|
||||
fn new() -> Self {
|
||||
Self { value: 42 }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
12
src/test/ui/typeck/issue-88844.stderr
Normal file
12
src/test/ui/typeck/issue-88844.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error[E0412]: cannot find type `Stuct` in this scope
|
||||
--> $DIR/issue-88844.rs:6:6
|
||||
|
|
||||
LL | struct Struct { value: i32 }
|
||||
| ------------- similarly named struct `Struct` defined here
|
||||
...
|
||||
LL | impl Stuct {
|
||||
| ^^^^^ help: a struct with a similar name exists: `Struct`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0412`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue