1 A reference has a longer lifetime than the data it references.
3 Erroneous code example:
10 impl<'a, T> SomeTrait<'a> for T {
11 type Output = &'a T; // compile error E0491
15 Here, the problem is that a reference type like `&'a T` is only valid
16 if all the data in T outlives the lifetime `'a`. But this impl as written
17 is applicable to any lifetime `'a` and any type `T` -- we have no guarantee
18 that `T` outlives `'a`. To fix this, you can add a where clause like
26 impl<'a, T> SomeTrait<'a> for T
30 type Output = &'a T; // compile error E0491