summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/alias_eq_cant_be_furthur_normalized.rs
blob: dc726ba51f94ffd18ab92635dfd134784f90d89f (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
26
27
28
29
// check-pass
// compile-flags: -Ztrait-solver=next

// check that a goal such as `alias-eq(<T as TraitB>::Assoc<bool>, <T as TraitB>::Assoc<?0>)`
// succeeds with a constraint that `?0 = bool`

// FIXME(deferred_projection_equality): add a test that this is true during coherence

trait TraitA {}

trait TraitB {
    type Assoc<T: ?Sized>;
}

impl<T: TraitB> TraitA for (T, T::Assoc<bool>) {}

impl TraitB for i32 {
    type Assoc<T: ?Sized> = u32;
}

fn needs_a<T: TraitA>() {}

fn bar<T: TraitB>() {
    needs_a::<(T, <T as TraitB>::Assoc<_>)>();
}

fn main() {
    bar::<i32>();
}