]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-42467.rs
Merge commit '61667dedf55e3e5aa584f7ae2bd0471336b92ce9' into sync_cg_clif-2021-09-19
[rust.git] / src / test / ui / issues / issue-42467.rs
1 // check-pass
2 #![allow(dead_code)]
3 struct Foo<T>(T);
4
5 struct IntoIter<T>(T);
6
7 impl<'a, T: 'a> Iterator for IntoIter<T> {
8     type Item = ();
9
10     fn next(&mut self) -> Option<()> {
11         None
12     }
13 }
14
15 impl<T> IntoIterator for Foo<T> {
16     type Item = ();
17     type IntoIter = IntoIter<T>;
18
19     fn into_iter(self) -> IntoIter<T> {
20         IntoIter(self.0)
21     }
22 }
23
24 fn main() {}