]>
Commit | Line | Data |
---|---|---|
3dfed10e | 1 | error[E0759]: `v` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement |
0731742a | 2 | --> $DIR/regions-close-object-into-object-2.rs:10:11 |
b7449926 | 3 | | |
f035d41b XL |
4 | LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> { |
5 | | ------------------ this data with lifetime `'a`... | |
dc9dc135 | 6 | LL | box B(&*v) as Box<dyn X> |
f035d41b | 7 | | ^^^ ...is captured here, requiring it to live as long as `'static` |
b7449926 | 8 | | |
f035d41b | 9 | help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v` |
b7449926 | 10 | | |
f035d41b | 11 | LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'a> { |
94222f64 | 12 | | ~~ |
f035d41b | 13 | help: alternatively, add an explicit `'static` bound to this reference |
60c5eb7d | 14 | | |
1b1a35ee | 15 | LL | fn g<'a, T: 'static>(v: Box<(dyn A<T> + 'static)>) -> Box<dyn X + 'static> { |
94222f64 | 16 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
b7449926 XL |
17 | |
18 | error: aborting due to previous error | |
19 | ||
f035d41b | 20 | For more information about this error, try `rustc --explain E0759`. |