1
1
error[E0310]: the parameter type `T` may not live long enough
2
2
--> $DIR/regions-close-object-into-object-5.rs:17:5
3
3
|
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`
6
+ LL | // oh dear!
4
7
LL | Box::new(B(&*v)) as Box<dyn X>
5
- | ^^^^^^^^
6
- |
7
- = help: consider adding an explicit lifetime bound `T: 'static`...
8
+ | ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
8
9
9
10
error[E0310]: the parameter type `T` may not live long enough
10
11
--> $DIR/regions-close-object-into-object-5.rs:17:5
11
12
|
13
+ LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
14
+ | - help: consider adding an explicit lifetime bound...: `T: 'static`
15
+ LL | // oh dear!
12
16
LL | Box::new(B(&*v)) as Box<dyn X>
13
- | ^^^^^^^^^^^^^^^^
14
- |
15
- = help: consider adding an explicit lifetime bound `T: 'static`...
17
+ | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
16
18
17
19
error[E0310]: the parameter type `T` may not live long enough
18
20
--> $DIR/regions-close-object-into-object-5.rs:17:5
19
21
|
22
+ LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
23
+ | - help: consider adding an explicit lifetime bound...: `T: 'static`
24
+ LL | // oh dear!
20
25
LL | Box::new(B(&*v)) as Box<dyn X>
21
- | ^^^^^^^^^^^^^^^^
22
- |
23
- = help: consider adding an explicit lifetime bound `T: 'static`...
26
+ | ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
24
27
25
28
error[E0515]: cannot return value referencing local data `*v`
26
29
--> $DIR/regions-close-object-into-object-5.rs:17:5
@@ -34,10 +37,11 @@ LL | Box::new(B(&*v)) as Box<dyn X>
34
37
error[E0310]: the parameter type `T` may not live long enough
35
38
--> $DIR/regions-close-object-into-object-5.rs:17:14
36
39
|
40
+ LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
41
+ | - help: consider adding an explicit lifetime bound...: `T: 'static`
42
+ LL | // oh dear!
37
43
LL | Box::new(B(&*v)) as Box<dyn X>
38
- | ^^^^^^
39
- |
40
- = help: consider adding an explicit lifetime bound `T: 'static`...
44
+ | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
41
45
42
46
error: aborting due to 5 previous errors
43
47
0 commit comments