]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/does-not-live-long-enough.rs
Auto merge of #83339 - Aaron1011:deep-recollect, r=petrochenkov
[rust.git] / src / test / ui / impl-trait / does-not-live-long-enough.rs
1 struct List {
2     data: Vec<String>,
3 }
4 impl List {
5     fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> {
6         self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref())
7         //~^ ERROR E0373
8     }
9 }
10
11 fn main() {}