1 #![feature(generic_associated_types)] 2 // check-fail 3 4 trait StreamingIter { 5 type Item<'a> where Self: 'a; next<'a>(&'a mut self) -> Option<Self::Item::<'a>>6 fn next<'a>(&'a mut self) -> Option<Self::Item::<'a>>; 7 } 8 9 struct StreamingSliceIter<'a, T> { 10 idx: usize, 11 data: &'a mut [T], 12 } 13 14 impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> { 15 type Item<'a> = &'a mut T; 16 //~^ the parameter type next(&mut self) -> Option<&mut T>17 fn next(&mut self) -> Option<&mut T> { 18 loop {} 19 } 20 } 21 main()22fn main() {} 23