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