1 error: unsatisfied lifetime constraints
2 --> $DIR/regions-close-object-into-object-2.rs:20:5
4 LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
5 | -- lifetime `'a` defined here
6 LL | box B(&*v) as Box<X> //~ ERROR cannot infer
7 | ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
9 error[E0597]: `*v` does not live long enough
10 --> $DIR/regions-close-object-into-object-2.rs:20:11
12 LL | box B(&*v) as Box<X> //~ ERROR cannot infer
13 | ^^^ borrowed value does not live long enough
15 | - `*v` dropped here while still borrowed
17 = note: borrowed value must be valid for the static lifetime...
19 error: aborting due to 2 previous errors
21 For more information about this error, try `rustc --explain E0597`.