]>
Commit | Line | Data |
---|---|---|
3dfed10e XL |
1 | // Regression test for issue #74918 |
2 | // Tests that we don't ICE after emitting an error | |
3 | ||
4 | struct ChunkingIterator<T, S: 'static + Iterator<Item = T>> { | |
5 | source: S, | |
6 | } | |
7 | ||
8 | impl<T, S: Iterator<Item = T>> Iterator for ChunkingIterator<T, S> { | |
9 | type Item = IteratorChunk<T, S>; //~ ERROR missing lifetime | |
10 | ||
cdc7bbd5 | 11 | fn next(&mut self) -> Option<IteratorChunk<T, S>> { |
3dfed10e XL |
12 | todo!() |
13 | } | |
14 | } | |
15 | ||
16 | struct IteratorChunk<'a, T, S: Iterator<Item = T>> { | |
17 | source: &'a mut S, | |
18 | } | |
19 | ||
20 | impl<T, S: Iterator<Item = T>> Iterator for IteratorChunk<'_, T, S> { | |
21 | type Item = T; | |
22 | ||
23 | fn next(&mut self) -> Option<T> { | |
24 | todo!() | |
25 | } | |
26 | } | |
27 | ||
28 | fn main() {} |