about summary refs log tree commit diff
path: root/tests/ui/specialization/coherence/default-item-normalization-ambig-1.rs
blob: af7cf332d5f4fe1a28c05a7220d8dc7fdad56f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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 {}
//~^ ERROR conflicting implementations of trait `Y` for type `<() as X>::U`

fn main() {
    ().f().g();
}