@@ -27,37 +27,64 @@ note: ...so that the reference type `&'static T` does not outlive the data it po
2727 | ^^^^^^^^^^^^^^^
2828
2929error[E0309]: the parameter type `K` may not live long enough
30- --> $DIR/lifetime-doesnt-live-long-enough.rs:35 :5
30+ --> $DIR/lifetime-doesnt-live-long-enough.rs:32 :5
3131 |
32- 34 | impl<K> Nested<K> {
32+ 31 | trait X<K>: Sized {
33+ | - help: consider adding an explicit lifetime bound `K: 'a`...
34+ 32 | fn foo<'a, L: X<&'a Nested<K>>>();
35+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36+ |
37+ note: ...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+ |
40+ 32 | fn foo<'a, L: X<&'a Nested<K>>>();
41+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42+
43+ error[E0309]: the parameter type `Self` may not live long enough
44+ --> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
45+ |
46+ 34 | fn bar<'a, L: X<&'a Nested<Self>>>();
47+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48+ |
49+ = help: consider adding an explicit lifetime bound `Self: 'a`...
50+ note: ...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+ |
53+ 34 | fn bar<'a, L: X<&'a Nested<Self>>>();
54+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
56+ error[E0309]: the parameter type `K` may not live long enough
57+ --> $DIR/lifetime-doesnt-live-long-enough.rs:39:5
58+ |
59+ 38 | impl<K> Nested<K> {
3360 | - help: consider adding an explicit lifetime bound `K: 'a`...
34- 35 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
35- 36 | | }
61+ 39 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
62+ 40 | | }
3663 | |_____^
3764 |
3865note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
39- --> $DIR/lifetime-doesnt-live-long-enough.rs:35 :5
66+ --> $DIR/lifetime-doesnt-live-long-enough.rs:39 :5
4067 |
41- 35 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
42- 36 | | }
68+ 39 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
69+ 40 | | }
4370 | |_____^
4471
4572error[E0309]: the parameter type `M` may not live long enough
46- --> $DIR/lifetime-doesnt-live-long-enough.rs:37 :5
73+ --> $DIR/lifetime-doesnt-live-long-enough.rs:41 :5
4774 |
48- 37 | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
75+ 41 | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
4976 | ^ -- help: consider adding an explicit lifetime bound `M: 'a`...
5077 | _____|
5178 | |
52- 38 | | }
79+ 42 | | }
5380 | |_____^
5481 |
5582note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
56- --> $DIR/lifetime-doesnt-live-long-enough.rs:37 :5
83+ --> $DIR/lifetime-doesnt-live-long-enough.rs:41 :5
5784 |
58- 37 | / fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
59- 38 | | }
85+ 41 | / fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
86+ 42 | | }
6087 | |_____^
6188
62- error: aborting due to 4 previous errors
89+ error: aborting due to 6 previous errors
6390
0 commit comments