]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/specialization-overlap-projection.rs
00b83c7e7a1b8eddd7d2328677901477c2973f55
[rust.git] / src / test / ui / specialization / specialization-overlap-projection.rs
1 // run-pass
2
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
7 #![feature(specialization)]
8
9 trait Assoc {
10     type Output;
11 }
12
13 impl<T> Assoc for T {
14     default 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() {}