]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-close-object-into-object-5.stderr
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / regions / regions-close-object-into-object-5.stderr
1 error[E0310]: the parameter type `T` may not live long enough
2   --> $DIR/regions-close-object-into-object-5.rs:17:5
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!
7 LL |     Box::new(B(&*v)) as Box<dyn X>
8    |     ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
9    |
10 note: ...that is required by this bound
11   --> $DIR/regions-close-object-into-object-5.rs:9:17
12    |
13 LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
14    |                 ^^
15
16 error[E0310]: the parameter type `T` may not live long enough
17   --> $DIR/regions-close-object-into-object-5.rs:17:5
18    |
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`
21 LL |     // oh dear!
22 LL |     Box::new(B(&*v)) as Box<dyn X>
23    |     ^^^^^^^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds
24
25 error[E0310]: the parameter type `T` may not live long enough
26   --> $DIR/regions-close-object-into-object-5.rs:17:14
27    |
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`
30 LL |     // oh dear!
31 LL |     Box::new(B(&*v)) as Box<dyn X>
32    |              ^ ...so that the type `T` will meet its required lifetime bounds
33
34 error[E0310]: the parameter type `T` may not live long enough
35   --> $DIR/regions-close-object-into-object-5.rs:17:14
36    |
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`
39 LL |     // oh dear!
40 LL |     Box::new(B(&*v)) as Box<dyn X>
41    |              ^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
42    |
43 note: ...that is required by this bound
44   --> $DIR/regions-close-object-into-object-5.rs:9:17
45    |
46 LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
47    |                 ^^
48
49 error[E0310]: the parameter type `T` may not live long enough
50   --> $DIR/regions-close-object-into-object-5.rs:17:16
51    |
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`
54 LL |     // oh dear!
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
57
58 error[E0310]: the parameter type `T` may not live long enough
59   --> $DIR/regions-close-object-into-object-5.rs:17:16
60    |
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`
63 LL |     // oh dear!
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
66
67 error[E0310]: the parameter type `T` may not live long enough
68   --> $DIR/regions-close-object-into-object-5.rs:17:16
69    |
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`
72 LL |     // oh dear!
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
75
76 error: aborting due to 7 previous errors
77
78 For more information about this error, try `rustc --explain E0310`.