Skip to content

Instantly share code, notes, and snippets.

@squiddy
Created June 14, 2014 21:25
Show Gist options
  • Save squiddy/9632f28d573e8593a4f4 to your computer and use it in GitHub Desktop.
Save squiddy/9632f28d573e8593a4f4 to your computer and use it in GitHub Desktop.
struct Foo<'a> {
a: Vec<String>,
b: Vec<Vec<&'a String>>
}
impl<'a> Foo<'a> {
fn bar(&mut self) {
let mut c = vec![];
c.push(self.a.get(0));
^~~~~~~~~~~~~~~~~ error: cannot infer an appropriate lifetime for autoref due to conflicting requirements
self.b.push(c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment