]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/impl-trait/static-return-lifetime-infered.rs
Auto merge of #95604 - nbdd0121:used2, r=petrochenkov
[rust.git] / src / test / ui / impl-trait / static-return-lifetime-infered.rs
index d792c6eafb32f27ea889552ea03bea1b7fbfa288..f940c1949d0b8345be0c2102b0702330e97bae2d 100644 (file)
@@ -4,14 +4,14 @@ struct A {
 
 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
-        self.x.iter().map(|a| a.0)
     }
     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
-        self.x.iter().map(|a| a.0)
     }
 }