]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/specialization-on-projection.rs
5606eaea3073dfb23dcecc911d725a89f6757e6c
[rust.git] / src / test / ui / specialization / specialization-on-projection.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 #![feature(specialization)]
5
6 // Ensure that specialization works for impls defined directly on a projection
7
8 trait Foo<T> {}
9
10 trait Assoc {
11     type Item;
12 }
13
14 impl<T: Assoc> Foo<T::Item> for T {}
15
16 struct Struct;
17
18 impl Assoc for Struct {
19     type Item = u8;
20 }
21
22 impl Foo<u8> for Struct {}
23
24 fn main() {}