summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/issue-84931.rs
blob: 9e247de16320391ca45bd3d777212b836acf52c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(generic_associated_types)]
// check-fail

trait StreamingIter {
    type Item<'a> where Self: 'a;
    fn next<'a>(&'a mut self) -> Option<Self::Item::<'a>>;
}

struct StreamingSliceIter<'a, T> {
    idx: usize,
    data: &'a mut [T],
}

impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> {
    type Item<'a> = &'a mut T;
    //~^ the parameter type
    fn next(&mut self) -> Option<&mut T> {
        loop {}
    }
}

fn main() {}