]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-close-object-into-object-2.nll.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-close-object-into-object-2.nll.stderr
CommitLineData
48663c56
XL
1error: lifetime may not live long enough
2 --> $DIR/regions-close-object-into-object-2.rs:10:5
3 |
dc9dc135 4LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
48663c56 5 | -- lifetime `'a` defined here
dc9dc135
XL
6LL | box B(&*v) as Box<dyn X>
7 | ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
60c5eb7d
XL
8 |
9 = help: consider replacing `'a` with `'static`
48663c56
XL
10
11error[E0515]: cannot return value referencing local data `*v`
12 --> $DIR/regions-close-object-into-object-2.rs:10:5
13 |
dc9dc135
XL
14LL | box B(&*v) as Box<dyn X>
15 | ^^^^^^---^^^^^^^^^^^^^^^
48663c56
XL
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`.