2019-01-27 05:03:21 -06:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/regions-close-object-into-object-2.rs:10:5
|
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
|
2019-01-27 05:03:21 -06:00
|
|
|
| -- lifetime `'a` defined here
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | box B(&*v) as Box<dyn X>
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
2019-10-27 09:39:14 -05:00
|
|
|
|
|
|
|
|
= help: consider replacing `'a` with `'static`
|
2019-01-27 05:03:21 -06:00
|
|
|
|
|
|
|
error[E0515]: cannot return value referencing local data `*v`
|
|
|
|
--> $DIR/regions-close-object-into-object-2.rs:10:5
|
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | box B(&*v) as Box<dyn X>
|
|
|
|
| ^^^^^^---^^^^^^^^^^^^^^^
|
2019-01-27 05:03:21 -06:00
|
|
|
| | |
|
|
|
|
| | `*v` is borrowed here
|
|
|
|
| returns a value referencing data owned by the current function
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0515`.
|