]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-74918-missing-lifetime.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / 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>> {
12         //~^ ERROR `impl` item signature doesn't match `trait` item signature
13         todo!()
14     }
15 }
16
17 struct IteratorChunk<'a, T, S: Iterator<Item = T>> {
18     source: &'a mut S,
19 }
20
21 impl<T, S: Iterator<Item = T>> Iterator for IteratorChunk<'_, T, S> {
22     type Item = T;
23
24     fn next(&mut self) -> Option<T> {
25         todo!()
26     }
27 }
28
29 fn main() {}