1 error[E0310]: the parameter type `U` may not live long enough
2 --> $DIR/regions-close-object-into-object-4.rs:9:5
4 LL | Box::new(B(&*v)) as Box<dyn X>
5 | ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
7 help: consider adding an explicit lifetime bound...
9 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
12 error[E0310]: the parameter type `U` may not live long enough
13 --> $DIR/regions-close-object-into-object-4.rs:9:5
15 LL | Box::new(B(&*v)) as Box<dyn X>
16 | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
18 help: consider adding an explicit lifetime bound...
20 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
23 error[E0310]: the parameter type `U` may not live long enough
24 --> $DIR/regions-close-object-into-object-4.rs:9:5
26 LL | Box::new(B(&*v)) as Box<dyn X>
27 | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
29 help: consider adding an explicit lifetime bound...
31 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
34 error: lifetime may not live long enough
35 --> $DIR/regions-close-object-into-object-4.rs:9:5
37 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
38 | -- lifetime `'a` defined here
39 LL | Box::new(B(&*v)) as Box<dyn X>
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
42 help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
44 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
46 help: alternatively, add an explicit `'static` bound to this reference
48 LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
49 | ~~~~~~~~~~~~~~~~~~~~~~~~~
51 error[E0515]: cannot return value referencing local data `*v`
52 --> $DIR/regions-close-object-into-object-4.rs:9:5
54 LL | Box::new(B(&*v)) as Box<dyn X>
55 | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^
57 | | `*v` is borrowed here
58 | returns a value referencing data owned by the current function
60 error[E0310]: the parameter type `U` may not live long enough
61 --> $DIR/regions-close-object-into-object-4.rs:9:14
63 LL | Box::new(B(&*v)) as Box<dyn X>
64 | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
66 help: consider adding an explicit lifetime bound...
68 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
71 error: aborting due to 6 previous errors
73 Some errors have detailed explanations: E0310, E0515.
74 For more information about an error, try `rustc --explain E0310`.