1 A lifetime bound was not satisfied.
3 Erroneous code example:
6 // Check that the explicit lifetime bound (`'SnowWhite`, in this example) must
7 // outlive all the superbounds from the trait (`'kiss`, in this example).
9 trait Wedding<'t>: 't { }
11 struct Prince<'kiss, 'SnowWhite> {
12 child: Box<Wedding<'kiss> + 'SnowWhite>,
13 // error: lifetime bound not satisfied
17 In this example, the `'SnowWhite` lifetime is supposed to outlive the `'kiss`
18 lifetime but the declaration of the `Prince` struct doesn't enforce it. To fix
19 this issue, you need to specify it:
22 trait Wedding<'t>: 't { }
24 struct Prince<'kiss, 'SnowWhite: 'kiss> { // You say here that 'SnowWhite
25 // must live longer than 'kiss.
26 child: Box<Wedding<'kiss> + 'SnowWhite>, // And now it's all good!