1 error[E0310]: the parameter type `T` may not live long enough
2 --> $DIR/regions-close-object-into-object-5.rs:17:5
4 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
5 | - help: consider adding an explicit lifetime bound...: `T: 'static`
7 LL | Box::new(B(&*v)) as Box<dyn X>
8 | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
10 note: ...that is required by this bound
11 --> $DIR/regions-close-object-into-object-5.rs:9:17
13 LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
16 error[E0310]: the parameter type `T` may not live long enough
17 --> $DIR/regions-close-object-into-object-5.rs:17:5
19 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
20 | - help: consider adding an explicit lifetime bound...: `T: 'static`
22 LL | Box::new(B(&*v)) as Box<dyn X>
23 | ^^^^^^^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds
25 error[E0310]: the parameter type `T` may not live long enough
26 --> $DIR/regions-close-object-into-object-5.rs:17:14
28 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
29 | - help: consider adding an explicit lifetime bound...: `T: 'static`
31 LL | Box::new(B(&*v)) as Box<dyn X>
32 | ^ ...so that the type `T` will meet its required lifetime bounds
34 error[E0310]: the parameter type `T` may not live long enough
35 --> $DIR/regions-close-object-into-object-5.rs:17:14
37 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
38 | - help: consider adding an explicit lifetime bound...: `T: 'static`
40 LL | Box::new(B(&*v)) as Box<dyn X>
41 | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
43 note: ...that is required by this bound
44 --> $DIR/regions-close-object-into-object-5.rs:9:17
46 LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
49 error[E0310]: the parameter type `T` may not live long enough
50 --> $DIR/regions-close-object-into-object-5.rs:17:16
52 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
53 | - help: consider adding an explicit lifetime bound...: `T: 'static`
55 LL | Box::new(B(&*v)) as Box<dyn X>
56 | ^^^ ...so that the reference type `&dyn A<T>` does not outlive the data it points at
58 error[E0310]: the parameter type `T` may not live long enough
59 --> $DIR/regions-close-object-into-object-5.rs:17:16
61 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
62 | - help: consider adding an explicit lifetime bound...: `T: 'static`
64 LL | Box::new(B(&*v)) as Box<dyn X>
65 | ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
67 error[E0310]: the parameter type `T` may not live long enough
68 --> $DIR/regions-close-object-into-object-5.rs:17:16
70 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
71 | - help: consider adding an explicit lifetime bound...: `T: 'static`
73 LL | Box::new(B(&*v)) as Box<dyn X>
74 | ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
76 error: aborting due to 7 previous errors
78 For more information about this error, try `rustc --explain E0310`.