1 error: unsatisfied lifetime constraints
2 --> $DIR/static-return-lifetime-infered.rs:17:9
4 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
5 | - let's call the lifetime of this reference `'1`
6 LL | self.x.iter().map(|a| a.0)
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
8 help: to allow this impl Trait to capture borrowed data with lifetime `'1`, add `'_` as a constraint
10 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 error: unsatisfied lifetime constraints
14 --> $DIR/static-return-lifetime-infered.rs:21:9
16 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
17 | -- lifetime `'a` defined here
18 LL | self.x.iter().map(|a| a.0)
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
20 help: to allow this impl Trait to capture borrowed data with lifetime `'a`, add `'a` as a constraint
22 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 error: aborting due to 2 previous errors