Rollup merge of #83699 - JohnTitor:issue-68830, r=Dylan-DPC

Add a regression test for issue-68830

Closes #68830
This commit is contained in:
Dylan DPC 2021-04-01 02:41:45 +02:00 committed by GitHub
commit e40601e952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// A regression test for #68830. This checks we don't emit
// a verbose `conflicting implementations` error.
#![feature(specialization)]
#![allow(incomplete_features)]
struct BadStruct {
err: MissingType //~ ERROR: cannot find type `MissingType` in this scope
}
trait MyTrait<T> {
fn foo();
}
impl<T, D> MyTrait<T> for D {
default fn foo() {}
}
impl<T> MyTrait<T> for BadStruct {
fn foo() {}
}
fn main() {}

View File

@ -0,0 +1,9 @@
error[E0412]: cannot find type `MissingType` in this scope
--> $DIR/issue-68830-spurious-diagnostics.rs:8:10
|
LL | err: MissingType
| ^^^^^^^^^^^ not found in this scope
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.