2 // check that trait matching can handle impls whose types are only
3 // constrained by a projection.
8 trait Mirror { type Image: ?Sized; }
9 impl<T: ?Sized> Mirror for T { type Image = T; }
12 impl<U: Mirror, V: Mirror<Image=L>, L: Mirror<Image=U>> Bar for V
13 where U::Image: IsU32 {}
15 trait Foo { fn name() -> &'static str; }
16 impl Foo for u64 { fn name() -> &'static str { "u64" } }
17 impl<T: Bar> Foo for T { fn name() -> &'static str { "Bar" }}
20 assert_eq!(<u64 as Foo>::name(), "u64");
21 assert_eq!(<u32 as Foo>::name(), "Bar");