fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
3.4 KiB101 linesraw
1error[E0310]: the parameter type `T` may not live long enough
2  --> $DIR/lifetime-doesnt-live-long-enough.rs:19:5
3   |
4LL | struct Foo<T> {
5   |            - help: consider adding an explicit lifetime bound `T: 'static`...
6LL |     foo: &'static T
7   |     ^^^^^^^^^^^^^^^
8   |
9note: ...so that the reference type `&'static T` does not outlive the data it points at
10  --> $DIR/lifetime-doesnt-live-long-enough.rs:19:5
11   |
12LL |     foo: &'static T
13   |     ^^^^^^^^^^^^^^^
14
15error[E0309]: the parameter type `K` may not live long enough
16  --> $DIR/lifetime-doesnt-live-long-enough.rs:24:5
17   |
18LL | trait X<K>: Sized {
19   |         - help: consider adding an explicit lifetime bound `K: 'a`...
20LL |     fn foo<'a, L: X<&'a Nested<K>>>();
21   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22   |
23note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
24  --> $DIR/lifetime-doesnt-live-long-enough.rs:24:5
25   |
26LL |     fn foo<'a, L: X<&'a Nested<K>>>();
27   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
29error[E0309]: the parameter type `Self` may not live long enough
30  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
31   |
32LL |     fn bar<'a, L: X<&'a Nested<Self>>>();
33   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34   |
35   = help: consider adding an explicit lifetime bound `Self: 'a`...
36note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
37  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
38   |
39LL |     fn bar<'a, L: X<&'a Nested<Self>>>();
40   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
42error[E0309]: the parameter type `L` may not live long enough
43  --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
44   |
45LL |       fn baz<'a, L, M: X<&'a Nested<L>>>() {
46   |       ^          - help: consider adding an explicit lifetime bound `L: 'a`...
47   |  _____|
48   | |
49LL | |
50LL | |     }
51   | |_____^
52   |
53note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
54  --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
55   |
56LL | /     fn baz<'a, L, M: X<&'a Nested<L>>>() {
57LL | |
58LL | |     }
59   | |_____^
60
61error[E0309]: the parameter type `K` may not live long enough
62  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
63   |
64LL |   impl<K> Nested<K> {
65   |        - help: consider adding an explicit lifetime bound `K: 'a`...
66LL | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
67LL | |
68LL | |     }
69   | |_____^
70   |
71note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
72  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
73   |
74LL | /     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
75LL | |
76LL | |     }
77   | |_____^
78
79error[E0309]: the parameter type `M` may not live long enough
80  --> $DIR/lifetime-doesnt-live-long-enough.rs:44:5
81   |
82LL |       fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
83   |       ^                                                -- help: consider adding an explicit lifetime bound `M: 'a`...
84   |  _____|
85   | |
86LL | |
87LL | |     }
88   | |_____^
89   |
90note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
91  --> $DIR/lifetime-doesnt-live-long-enough.rs:44:5
92   |
93LL | /     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
94LL | |
95LL | |     }
96   | |_____^
97
98error: aborting due to 6 previous errors
99
100Some errors have detailed explanations: E0309, E0310.
101For more information about an error, try `rustc --explain E0309`.