1 error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
2 --> $DIR/static-return-lifetime-infered.rs:7:9
4 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
5 | ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:30]>` captures the anonymous lifetime defined here
6 LL | self.x.iter().map(|a| a.0)
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
9 help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
11 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
14 error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
15 --> $DIR/static-return-lifetime-infered.rs:7:9
17 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
18 | ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:30]>` captures the anonymous lifetime defined here
19 LL | self.x.iter().map(|a| a.0)
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
22 help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
24 LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
27 error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
28 --> $DIR/static-return-lifetime-infered.rs:12:9
30 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
31 | -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:30]>` captures the lifetime `'a` as defined here
32 LL | self.x.iter().map(|a| a.0)
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
35 help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
37 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
40 error[E0700]: hidden type for `impl Iterator<Item = u32>` captures lifetime that does not appear in bounds
41 --> $DIR/static-return-lifetime-infered.rs:12:9
43 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
44 | -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:30]>` captures the lifetime `'a` as defined here
45 LL | self.x.iter().map(|a| a.0)
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
48 help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
50 LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
53 error: aborting due to 4 previous errors
55 For more information about this error, try `rustc --explain E0700`.