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