error: lifetime may not live long enough --> $DIR/trait-object-nested-in-impl-trait.rs:28:9 | LL | fn iter(&self) -> impl Iterator> { | - let's call the lifetime of this reference `'1` LL | / Iter { LL | | current: None, LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'1` must outlive `'static` | help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound | LL | fn iter(&self) -> impl Iterator> + '_ { | ++++ error: lifetime may not live long enough --> $DIR/trait-object-nested-in-impl-trait.rs:39:9 | LL | fn iter(&self) -> impl Iterator> + '_ { | - let's call the lifetime of this reference `'1` LL | / Iter { LL | | current: None, LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough --> $DIR/trait-object-nested-in-impl-trait.rs:50:9 | LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { | -- lifetime `'a` defined here LL | / Iter { LL | | current: None, LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough --> $DIR/trait-object-nested-in-impl-trait.rs:61:9 | LL | fn iter<'a>(&'a self) -> impl Iterator> { | -- lifetime `'a` defined here LL | / Iter { LL | | current: None, LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'a` must outlive `'static` | help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound | LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { | ++++ error: aborting due to 4 previous errors