]>
Commit | Line | Data |
---|---|---|
48663c56 XL |
1 | error: lifetime may not live long enough |
2 | --> $DIR/regions-close-object-into-object-2.rs:10:5 | |
3 | | | |
dc9dc135 | 4 | LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> { |
48663c56 | 5 | | -- lifetime `'a` defined here |
dc9dc135 XL |
6 | LL | 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 | |
11 | error[E0515]: cannot return value referencing local data `*v` | |
12 | --> $DIR/regions-close-object-into-object-2.rs:10:5 | |
13 | | | |
dc9dc135 XL |
14 | LL | 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 | ||
20 | error: aborting due to 2 previous errors | |
21 | ||
22 | For more information about this error, try `rustc --explain E0515`. |