fork/rust
git clone https://git.julia.blue/fork/rust
8d69840ab92
1.43.1
1error: lifetime may not live long enough 2 --> $DIR/regions-close-object-into-object-2.rs:10:5 3 | 4LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> { 5 | -- lifetime `'a` defined here 6LL | box B(&*v) as Box<dyn X> 7 | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` 8 | 9 = help: consider replacing `'a` with `'static` 10 11error[E0515]: cannot return value referencing local data `*v` 12 --> $DIR/regions-close-object-into-object-2.rs:10:5 13 | 14LL | box B(&*v) as Box<dyn X> 15 | ^^^^^^---^^^^^^^^^^^^^^^ 16 | | | 17 | | `*v` is borrowed here 18 | returns a value referencing data owned by the current function 19 20error: aborting due to 2 previous errors 21 22For more information about this error, try `rustc --explain E0515`.