1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// check-pass #![feature(generic_associated_types)] #![allow(non_camel_case_types)] trait HasAssoc { type Assoc; } trait Iterate<S: HasAssoc> { type Iter<'a> where Self: 'a; } struct KeySegment_Broken<T> { key: T, } impl<S: HasAssoc> Iterate<S> for KeySegment_Broken<S::Assoc> { type Iter<'a> = () where Self: 'a; } fn main() {}