1 When using a lifetime like `'a` in a type, it must be declared before being
4 These two examples illustrate the problem:
7 // error, use of undeclared lifetime name `'a`
11 // error, use of undeclared lifetime name `'a`
16 These can be fixed by declaring lifetime parameters:
23 fn foo<'a>(x: &'a str) {}
26 Impl blocks declare lifetime parameters separately. You need to add lifetime
27 parameters to an impl block if you're implementing a type that has a lifetime
36 // error, use of undeclared lifetime name `'a`
38 fn foo<'a>(x: &'a str) {}
42 This is fixed by declaring the impl block like this: