blob: 04d1b949692cdc8694f554920cdd58d8773a5de1 (
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: -Znext-solver
// 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>();
}
|