]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-close-object-into-object-4.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-close-object-into-object-4.stderr
1 error[E0310]: the parameter type `U` may not live long enough
2 --> $DIR/regions-close-object-into-object-4.rs:9:5
3 |
4 LL | Box::new(B(&*v)) as Box<dyn X>
5 | ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
6 |
7 help: consider adding an explicit lifetime bound...
8 |
9 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
10 | +++++++++
11
12 error[E0310]: the parameter type `U` may not live long enough
13 --> $DIR/regions-close-object-into-object-4.rs:9:5
14 |
15 LL | Box::new(B(&*v)) as Box<dyn X>
16 | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
17 |
18 help: consider adding an explicit lifetime bound...
19 |
20 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
21 | +++++++++
22
23 error[E0310]: the parameter type `U` may not live long enough
24 --> $DIR/regions-close-object-into-object-4.rs:9:5
25 |
26 LL | Box::new(B(&*v)) as Box<dyn X>
27 | ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
28 |
29 help: consider adding an explicit lifetime bound...
30 |
31 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
32 | +++++++++
33
34 error: lifetime may not live long enough
35 --> $DIR/regions-close-object-into-object-4.rs:9:5
36 |
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`
41 |
42 help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
43 |
44 LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
45 | ~~
46 help: alternatively, add an explicit `'static` bound to this reference
47 |
48 LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
49 | ~~~~~~~~~~~~~~~~~~~~~~~~~
50
51 error[E0515]: cannot return value referencing local data `*v`
52 --> $DIR/regions-close-object-into-object-4.rs:9:5
53 |
54 LL | Box::new(B(&*v)) as Box<dyn X>
55 | ^^^^^^^^^^^---^^^^^^^^^^^^^^^^
56 | | |
57 | | `*v` is borrowed here
58 | returns a value referencing data owned by the current function
59
60 error[E0310]: the parameter type `U` may not live long enough
61 --> $DIR/regions-close-object-into-object-4.rs:9:14
62 |
63 LL | Box::new(B(&*v)) as Box<dyn X>
64 | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
65 |
66 help: consider adding an explicit lifetime bound...
67 |
68 LL | fn i<'a, T, U: 'static>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
69 | +++++++++
70
71 error: aborting due to 6 previous errors
72
73 Some errors have detailed explanations: E0310, E0515.
74 For more information about an error, try `rustc --explain E0310`.