]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
New upstream version 1.22.1+dfsg1
[rustc.git] / src / test / ui / lifetimes / lifetime-doesnt-live-long-enough.stderr
CommitLineData
ea8adc8c
XL
1error[E0309]: the parameter type `T` may not live long enough
2 --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
3 |
417 | struct List<'a, T: ListItem<'a>> {
5 | -- help: consider adding an explicit lifetime bound `T: 'a`...
618 | slice: &'a [T]
7 | ^^^^^^^^^^^^^^
8 |
9note: ...so that the reference type `&'a [T]` does not outlive the data it points at
10 --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
11 |
1218 | slice: &'a [T]
13 | ^^^^^^^^^^^^^^
14
15error[E0310]: the parameter type `T` may not live long enough
16 --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
17 |
1827 | struct Foo<T> {
19 | - help: consider adding an explicit lifetime bound `T: 'static`...
2028 | foo: &'static T
21 | ^^^^^^^^^^^^^^^
22 |
23note: ...so that the reference type `&'static T` does not outlive the data it points at
24 --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
25 |
2628 | foo: &'static T
27 | ^^^^^^^^^^^^^^^
28
29error[E0309]: the parameter type `K` may not live long enough
30 --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
31 |
3231 | trait X<K>: Sized {
33 | - help: consider adding an explicit lifetime bound `K: 'a`...
3432 | fn foo<'a, L: X<&'a Nested<K>>>();
35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 |
37note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
38 --> $DIR/lifetime-doesnt-live-long-enough.rs:32:5
39 |
4032 | fn foo<'a, L: X<&'a Nested<K>>>();
41 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43error[E0309]: the parameter type `Self` may not live long enough
44 --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
45 |
4634 | fn bar<'a, L: X<&'a Nested<Self>>>();
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 |
49 = help: consider adding an explicit lifetime bound `Self: 'a`...
50note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
51 --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
52 |
5334 | fn bar<'a, L: X<&'a Nested<Self>>>();
54 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
56error[E0309]: the parameter type `K` may not live long enough
57 --> $DIR/lifetime-doesnt-live-long-enough.rs:39:5
58 |
5938 | impl<K> Nested<K> {
60 | - help: consider adding an explicit lifetime bound `K: 'a`...
6139 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
6240 | | }
63 | |_____^
64 |
65note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
66 --> $DIR/lifetime-doesnt-live-long-enough.rs:39:5
67 |
6839 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
6940 | | }
70 | |_____^
71
72error[E0309]: the parameter type `M` may not live long enough
73 --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
74 |
7541 | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
76 | ^ -- help: consider adding an explicit lifetime bound `M: 'a`...
77 | _____|
78 | |
7942 | | }
80 | |_____^
81 |
82note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
83 --> $DIR/lifetime-doesnt-live-long-enough.rs:41:5
84 |
8541 | / fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
8642 | | }
87 | |_____^
88
89error: aborting due to 6 previous errors
90