summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-42479.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-42479.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-42479.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-42479.rs b/tests/ui/impl-trait/issues/issue-42479.rs
new file mode 100644
index 000000000..efc1f975d
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-42479.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+use std::iter::once;
+
+struct Foo {
+ x: i32,
+}
+
+impl Foo {
+ fn inside(&self) -> impl Iterator<Item = &i32> {
+ once(&self.x)
+ }
+}
+
+fn main() {
+ println!("hi");
+}