summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/static-return-lifetime-infered.rs
blob: f940c1949d0b8345be0c2102b0702330e97bae2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct A {
    x: [(u32, u32); 10]
}

impl A {
    fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
        self.x.iter().map(|a| a.0)
        //~^ ERROR: captures lifetime that does not appear in bounds
        //~| 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)
        //~^ ERROR: captures lifetime that does not appear in bounds
        //~| ERROR: captures lifetime that does not appear in bounds
    }
}

fn main() {}