c30e15aded
Trait predicates for types which have errors may still evaluate to OK leading to downstream ICEs. Now we return a selection error for such types in candidate assembly and thereby prevent such issues
25 lines
512 B
Rust
25 lines
512 B
Rust
// 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 {
|
|
//~^ ERROR: conflicting implementations of trait `MyTrait<_>` for type `BadStruct`
|
|
fn foo() {}
|
|
}
|
|
|
|
fn main() {}
|