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
3.4 KiB85 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:19
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:19
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:19
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:19
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:22
44   |
45LL |     fn baz<'a, L, M: X<&'a Nested<L>>>() {
46   |                -     ^^^^^^^^^^^^^^^^
47   |                |
48   |                help: consider adding an explicit lifetime bound...: `L: 'a`
49   |
50note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
51  --> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
52   |
53LL |     fn baz<'a, L, M: X<&'a Nested<L>>>() {
54   |                      ^^^^^^^^^^^^^^^^
55
56error[E0309]: the parameter type `K` may not live long enough
57  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
58   |
59LL | impl<K> Nested<K> {
60   |      - help: consider adding an explicit lifetime bound...: `K: 'a`
61LL |     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
62   |                                 ^^^^^^^^^^^^^^^^
63   |
64note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
65  --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
66   |
67LL |     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
68   |                                 ^^^^^^^^^^^^^^^^
69
70error[E0309]: the parameter type `M` may not live long enough
71  --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
72   |
73LL |     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
74   |                                    ^^^^^^^^^^^^^^^^  -- help: consider adding an explicit lifetime bound...: `M: 'a +`
75   |
76note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
77  --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
78   |
79LL |     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
80   |                                    ^^^^^^^^^^^^^^^^
81
82error: aborting due to 6 previous errors
83
84Some errors have detailed explanations: E0309, E0310.
85For more information about an error, try `rustc --explain E0309`.