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(),
}
}
}
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(),
}
}
}
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(),
}
}
}
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(),
}
}
}