1 An undeclared lifetime was used.
3 Erroneous code example:
6 // error, use of undeclared lifetime name `'a`
10 // error, use of undeclared lifetime name `'a`
15 These can be fixed by declaring lifetime parameters:
22 fn foo<'a>(x: &'a str) {}
25 Impl blocks declare lifetime parameters separately. You need to add lifetime
26 parameters to an impl block if you're implementing a type that has a lifetime
35 // error, use of undeclared lifetime name `'a`
37 fn foo<'a>(x: &'a str) {}
41 This is fixed by declaring the impl block like this: