1 error: lifetime may not live long enough
2 --> $DIR/static-return-lifetime-infered.rs:6:35
4 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
5 | - ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
7 | let's call the lifetime of this reference `'1`
9 help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
11 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
14 error: lifetime may not live long enough
15 --> $DIR/static-return-lifetime-infered.rs:9:37
17 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
18 | -- ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
20 | lifetime `'a` defined here
22 = help: consider replacing `'a` with `'static`
23 help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
25 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
28 error: aborting due to 2 previous errors