]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/static-return-lifetime-infered.rs
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / ui / impl-trait / static-return-lifetime-infered.rs
1 struct A {
2     x: [(u32, u32); 10]
3 }
4
5 impl A {
6     fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
7         self.x.iter().map(|a| a.0)
8         //~^ ERROR: captures lifetime that does not appear in bounds
9         //~| ERROR: captures lifetime that does not appear in bounds
10     }
11     fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
12         self.x.iter().map(|a| a.0)
13         //~^ ERROR: captures lifetime that does not appear in bounds
14         //~| ERROR: captures lifetime that does not appear in bounds
15     }
16 }
17
18 fn main() {}