rust/tests/ui/impl-trait/static-return-lifetime-infered.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
405 B
Rust
Raw Normal View History

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