Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a regression test for issue-68830 #83699

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/test/ui/specialization/issue-68830-spurious-diagnostics.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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`.