3 // Ensure that provided items are inherited properly even when impls vary in
4 // type parameters *and* rely on projections, and the type parameters are input
7 #![feature(specialization)]
10 fn convert(&self) -> T;
14 fn as_item(&self) -> &Self::Item;
17 impl<T, U> Trait<U> for T where T: WithAssoc<Item=U>, U: Clone {
18 fn convert(&self) -> U {
19 self.as_item().clone()
23 impl WithAssoc for u8 {
25 fn as_item(&self) -> &u8 { self }
28 impl Trait<u8> for u8 {}
31 assert!(3u8.convert() == 3u8);