about summary refs log tree commit diff
path: root/tests/ui/issues/issue-42467.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-42467.rs')
-rw-r--r--tests/ui/issues/issue-42467.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-42467.rs b/tests/ui/issues/issue-42467.rs
new file mode 100644
index 00000000000..afa1bcd13fc
--- /dev/null
+++ b/tests/ui/issues/issue-42467.rs
@@ -0,0 +1,24 @@
+// check-pass
+#![allow(dead_code)]
+struct Foo<T>(T);
+
+struct IntoIter<T>(T);
+
+impl<'a, T: 'a> Iterator for IntoIter<T> {
+    type Item = ();
+
+    fn next(&mut self) -> Option<()> {
+        None
+    }
+}
+
+impl<T> IntoIterator for Foo<T> {
+    type Item = ();
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> IntoIter<T> {
+        IntoIter(self.0)
+    }
+}
+
+fn main() {}