2018-06-08 01:07:46 -05:00
|
|
|
struct A {
|
|
|
|
x: [(u32, u32); 10]
|
|
|
|
}
|
|
|
|
|
|
|
|
impl A {
|
|
|
|
fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
|
2022-02-14 10:10:22 -06:00
|
|
|
self.x.iter().map(|a| a.0)
|
2021-09-23 10:21:01 -05:00
|
|
|
//~^ ERROR: captures lifetime that does not appear in bounds
|
2018-06-08 01:07:46 -05:00
|
|
|
}
|
|
|
|
fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
|
2022-02-14 10:10:22 -06:00
|
|
|
self.x.iter().map(|a| a.0)
|
2021-09-23 10:21:01 -05:00
|
|
|
//~^ ERROR: captures lifetime that does not appear in bounds
|
2018-06-08 01:07:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|