]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-42467.rs
New upstream version 1.60.0+dfsg1
[rustc.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() {}