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