fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
773 B20 linesraw
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
9error[E0515]: cannot return value referencing local data `*v`
10  --> $DIR/regions-close-object-into-object-2.rs:10:5
11   |
12LL |     box B(&*v) as Box<dyn X>
13   |     ^^^^^^---^^^^^^^^^^^^^^^
14   |     |     |
15   |     |     `*v` is borrowed here
16   |     returns a value referencing data owned by the current function
17
18error: aborting due to 2 previous errors
19
20For more information about this error, try `rustc --explain E0515`.