]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-84931.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-84931.rs
1 #![feature(generic_associated_types)]
2 // check-fail
3
4 trait StreamingIter {
5     type Item<'a> where Self: '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
17     fn next(&mut self) -> Option<&mut T> {
18         loop {}
19     }
20 }
21
22 fn main() {}