]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/specialization-on-projection.rs
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / specialization / specialization-on-projection.rs
1 // run-pass
2 #![allow(dead_code)]
3
4 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
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() {}