rust/tests/ui/specialization/coherence/default-item-normalization-ambig-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
428 B
Rust
Raw Normal View History

2024-09-21 02:04:42 -05:00
// regression test for #73299.
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait X {
type U;
fn f(&self) -> Self::U {
loop {}
}
}
impl<T> X for T {
default type U = ();
}
trait Y {
fn g(&self) {}
}
impl Y for <() as X>::U {}
impl Y for <i32 as X>::U {}
2024-09-21 02:04:42 -05:00
//~^ ERROR conflicting implementations of trait `Y` for type `<() as X>::U`
fn main() {
().f().g();
}