fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
2.0 KiB64 linesraw
1error[E0310]: the parameter type `T` may not live long enough
2  --> $DIR/regions-close-param-into-object.rs:6:5
3   |
4LL | fn p1<T>(v: T) -> Box<dyn X + 'static>
5   |       - help: consider adding an explicit lifetime bound...: `T: 'static`
6...
7LL |     Box::new(v)
8   |     ^^^^^^^^^^^
9   |
10note: ...so that the type `T` will meet its required lifetime bounds
11  --> $DIR/regions-close-param-into-object.rs:6:5
12   |
13LL |     Box::new(v)
14   |     ^^^^^^^^^^^
15
16error[E0310]: the parameter type `T` may not live long enough
17  --> $DIR/regions-close-param-into-object.rs:12:5
18   |
19LL | fn p2<T>(v: Box<T>) -> Box<dyn X + 'static>
20   |       - help: consider adding an explicit lifetime bound...: `T: 'static`
21...
22LL |     Box::new(v)
23   |     ^^^^^^^^^^^
24   |
25note: ...so that the type `std::boxed::Box<T>` will meet its required lifetime bounds
26  --> $DIR/regions-close-param-into-object.rs:12:5
27   |
28LL |     Box::new(v)
29   |     ^^^^^^^^^^^
30
31error[E0309]: the parameter type `T` may not live long enough
32  --> $DIR/regions-close-param-into-object.rs:18:5
33   |
34LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
35   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
36...
37LL |     Box::new(v)
38   |     ^^^^^^^^^^^
39   |
40note: ...so that the type `T` will meet its required lifetime bounds
41  --> $DIR/regions-close-param-into-object.rs:18:5
42   |
43LL |     Box::new(v)
44   |     ^^^^^^^^^^^
45
46error[E0309]: the parameter type `T` may not live long enough
47  --> $DIR/regions-close-param-into-object.rs:24:5
48   |
49LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
50   |          - help: consider adding an explicit lifetime bound...: `T: 'a`
51...
52LL |     Box::new(v)
53   |     ^^^^^^^^^^^
54   |
55note: ...so that the type `std::boxed::Box<T>` will meet its required lifetime bounds
56  --> $DIR/regions-close-param-into-object.rs:24:5
57   |
58LL |     Box::new(v)
59   |     ^^^^^^^^^^^
60
61error: aborting due to 4 previous errors
62
63Some errors have detailed explanations: E0309, E0310.
64For more information about an error, try `rustc --explain E0309`.