// check-pass #![feature(associated_type_defaults)] trait Tr { type Item = u8; type Container = Vec; } impl Tr for () {} impl Tr for u16 { type Item = u16; } impl Tr for String { type Container = String; } impl Tr for usize { type Item = u32; type Container = Vec<()>; } fn main() { let _container: <() as Tr>::Container = Vec::::new(); let _item: <() as Tr>::Item = 0u8; let _container: ::Container = Vec::::new(); let _item: ::Item = 0u16; let _container: ::Container = String::new(); let _item: ::Item = 0u8; let _container: ::Container = Vec::<()>::new(); let _item: ::Item = 0u32; }