]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-74918-missing-lifetime.rs
Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyup
[rust.git] / src / test / ui / mismatched_types / issue-74918-missing-lifetime.rs
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
11     fn next(&mut self) -> Option<IteratorChunk<T, S>> { //~ ERROR `impl`
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() {}