]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | // run-pass |
2 | ||
7cac9316 XL |
3 | // Test that impls on projected self types can resolve overlap, even when the |
4 | // projections involve specialization, so long as the associated type is | |
5 | // provided by the most specialized impl. | |
6 | ||
f035d41b | 7 | #![feature(specialization)] //~ WARN the feature `specialization` is incomplete |
7cac9316 XL |
8 | |
9 | trait Assoc { | |
10 | type Output; | |
11 | } | |
12 | ||
13 | default impl<T> Assoc for T { | |
14 | type Output = bool; | |
15 | } | |
16 | ||
17 | impl Assoc for u8 { type Output = u8; } | |
18 | impl Assoc for u16 { type Output = u16; } | |
19 | ||
20 | trait Foo {} | |
21 | impl Foo for u32 {} | |
22 | impl Foo for <u8 as Assoc>::Output {} | |
23 | impl Foo for <u16 as Assoc>::Output {} | |
24 | ||
25 | fn main() {} |