about summary refs log tree commit diff
path: root/tests/ui/associated-types/mismatch-two-relevant-impls.rs
blob: 58fd567c27800a1c1188d087fa09c01ce29310ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
trait Tr {
    type Assoc;
}

struct W<T>(T);

impl Tr for W<i32> {
    type Assoc = u32;
}

impl Tr for W<u32> {
    type Assoc = i32;
}

fn needs_unit<T: Tr<Assoc = ()>>() {}

fn main() {
    needs_unit::<W<i32>>();
    //~^ ERROR type mismatch resolving `<W<i32> as Tr>::Assoc == ()`
}