]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/impl-trait/lifetimes.rs
fix nested impl trait lifetimes
[rust.git] / src / test / run-pass / impl-trait / lifetimes.rs
index 1f2d76f28947243c10fd7fa8e25d8639a6193f2d..213a46ded8e765d6ea782b4ed54de1b59de1eec1 100644 (file)
@@ -50,6 +50,14 @@ fn closure_hr_elided_return() -> impl Fn(&u32) -> &u32 { |x| x }
 fn closure_pass_through_elided_return(x: impl Fn(&u32) -> &u32) -> impl Fn(&u32) -> &u32 { x }
 fn closure_pass_through_reference_elided(x: &impl Fn(&u32) -> &u32) -> &impl Fn(&u32) -> &u32 { x }
 
+fn nested_lifetime<'a>(input: &'a str)
+    -> impl Iterator<Item = impl Iterator<Item = i32> + 'a> + 'a
+{
+    input.lines().map(|line| {
+        line.split_whitespace().map(|cell| cell.parse().unwrap())
+    })
+}
+
 fn pass_through_elision(x: &u32) -> impl Into<&u32> { x }
 fn pass_through_elision_with_fn_ptr(x: &fn(&u32) -> &u32) -> impl Into<&fn(&u32) -> &u32> { x }