]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / suggestions / lifetimes / trait-object-nested-in-impl-trait.rs
index d8446e58dbb63eb9e7b593d69e6ae660492a232e..ff27011f89e8391b07e18a19488409cec44b347b 100644 (file)
@@ -26,8 +26,9 @@ struct Bar(Vec<Box<dyn Foo>>);
 impl Bar {
     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> {
         Iter {
+            //~^ ERROR lifetime may not live long enough
             current: None,
-            remaining: self.0.iter(), //~ ERROR E0759
+            remaining: self.0.iter(),
         }
     }
 }
@@ -37,8 +38,9 @@ struct Baz(Vec<Box<dyn Foo>>);
 impl Baz {
     fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
         Iter {
+            //~^ ERROR lifetime may not live long enough
             current: None,
-            remaining: self.0.iter(), //~ ERROR E0759
+            remaining: self.0.iter(),
         }
     }
 }
@@ -48,8 +50,9 @@ struct Bat(Vec<Box<dyn Foo>>);
 impl Bat {
     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
         Iter {
+            //~^ ERROR lifetime may not live long enough
             current: None,
-            remaining: self.0.iter(), //~ ERROR E0759
+            remaining: self.0.iter(),
         }
     }
 }
@@ -59,8 +62,9 @@ struct Ban(Vec<Box<dyn Foo>>);
 impl Ban {
     fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> {
         Iter {
+            //~^ ERROR lifetime may not live long enough
             current: None,
-            remaining: self.0.iter(), //~ ERROR E0759
+            remaining: self.0.iter(),
         }
     }
 }