1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// compile-flags: --crate-type=lib // check-pass #![feature(type_alias_impl_trait)] type Alias = impl Sized; fn constrain() -> Alias { 1i32 } trait HideIt { type Assoc; } impl HideIt for () { type Assoc = Alias; } pub trait Yay {} impl Yay for <() as HideIt>::Assoc {}