]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-close-object-into-object-5.stderr
Apply suggestions from code review
[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 B(&*v) as Box<X>
8    |     ^^^^^^^^^^ ...so that the type `B<'_, T>` will meet its required lifetime bounds
9
10 error[E0310]: the parameter type `T` may not live long enough
11   --> $DIR/regions-close-object-into-object-5.rs:17:9
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!
16 LL |     box B(&*v) as Box<X>
17    |         ^ ...so that the type `T` will meet its required lifetime bounds
18
19 error[E0310]: the parameter type `T` may not live long enough
20   --> $DIR/regions-close-object-into-object-5.rs:17:9
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!
25 LL |     box B(&*v) as Box<X>
26    |         ^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
27    |
28 note: ...that is required by this bound
29   --> $DIR/regions-close-object-into-object-5.rs:9:17
30    |
31 LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
32    |                 ^^
33
34 error[E0310]: the parameter type `T` may not live long enough
35   --> $DIR/regions-close-object-into-object-5.rs:17:11
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 B(&*v) as Box<X>
41    |           ^^^ ...so that the reference type `&dyn A<T>` does not outlive the data it points at
42
43 error[E0310]: the parameter type `T` may not live long enough
44   --> $DIR/regions-close-object-into-object-5.rs:17:11
45    |
46 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
47    |          - help: consider adding an explicit lifetime bound...: `T: 'static`
48 LL |     // oh dear!
49 LL |     box B(&*v) as Box<X>
50    |           ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
51
52 error[E0310]: the parameter type `T` may not live long enough
53   --> $DIR/regions-close-object-into-object-5.rs:17:11
54    |
55 LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
56    |          - help: consider adding an explicit lifetime bound...: `T: 'static`
57 LL |     // oh dear!
58 LL |     box B(&*v) as Box<X>
59    |           ^^^ ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long
60
61 error: aborting due to 6 previous errors
62
63 For more information about this error, try `rustc --explain E0310`.