-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #83699 - JohnTitor:issue-68830, r=Dylan-DPC
Add a regression test for issue-68830 Closes #68830
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/test/ui/specialization/issue-68830-spurious-diagnostics.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |