]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
New upstream version 1.64.0+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
3dfed10e 2 --> $DIR/lifetime-doesnt-live-long-enough.rs:19:10
ea8adc8c 3 |
0531ce1d 4LL | foo: &'static T
3dfed10e 5 | ^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
04454e1e
FG
6 |
7help: consider adding an explicit lifetime bound...
8 |
9LL | struct Foo<T: 'static> {
10 | +++++++++
ea8adc8c 11
064997fb
FG
12error[E0309]: the parameter type `K` may not live long enough
13 --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
14 |
15LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
16 | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
17 |
18help: consider adding an explicit lifetime bound...
19 |
20LL | impl<K: 'a> Nested<K> {
21 | ++++
22
23error[E0309]: the parameter type `M` may not live long enough
24 --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
25 |
26LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
27 | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
28 |
29help: consider adding an explicit lifetime bound...
30 |
31LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b + 'a>() {
32 | ++++
33
ea8adc8c 34error[E0309]: the parameter type `K` may not live long enough
74b04a01 35 --> $DIR/lifetime-doesnt-live-long-enough.rs:24:19
ea8adc8c 36 |
0531ce1d 37LL | fn foo<'a, L: X<&'a Nested<K>>>();
f9f354fc 38 | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
04454e1e
FG
39 |
40help: consider adding an explicit lifetime bound...
41 |
42LL | trait X<K: 'a>: Sized {
43 | ++++
ea8adc8c
XL
44
45error[E0309]: the parameter type `Self` may not live long enough
74b04a01 46 --> $DIR/lifetime-doesnt-live-long-enough.rs:28:19
ea8adc8c 47 |
0531ce1d 48LL | fn bar<'a, L: X<&'a Nested<Self>>>();
74b04a01 49 | ^^^^^^^^^^^^^^^^^^^
ea8adc8c
XL
50 |
51 = help: consider adding an explicit lifetime bound `Self: 'a`...
f9f354fc 52 = note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
ea8adc8c 53
ff7c6d11 54error[E0309]: the parameter type `L` may not live long enough
74b04a01 55 --> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
ff7c6d11 56 |
74b04a01 57LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
04454e1e
FG
58 | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
59 |
60help: consider adding an explicit lifetime bound...
61 |
62LL | fn baz<'a, L: 'a, M: X<&'a Nested<L>>>() {
63 | ++++
ff7c6d11 64
0bf4aa26 65error: aborting due to 6 previous errors
ea8adc8c 66
48663c56 67Some errors have detailed explanations: E0309, E0310.
0531ce1d 68For more information about an error, try `rustc --explain E0309`.