2017-09-23 02:13:19 +00:00
|
|
|
error[E0309]: the parameter type `T` may not live long enough
|
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
|
|
|
|
|
|
|
|
|
17 | struct List<'a, T: ListItem<'a>> {
|
|
|
|
| -- help: consider adding an explicit lifetime bound `T: 'a`...
|
|
|
|
18 | slice: &'a [T]
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'a [T]` does not outlive the data it points at
|
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
|
|
|
|
|
|
|
|
|
18 | slice: &'a [T]
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0310]: the parameter type `T` may not live long enough
|
2017-11-20 12:13:27 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
|
2017-09-23 02:13:19 +00:00
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
28 | struct Foo<T> {
|
2017-09-23 02:13:19 +00:00
|
|
|
| - help: consider adding an explicit lifetime bound `T: 'static`...
|
2017-11-20 12:13:27 +00:00
|
|
|
29 | foo: &'static T
|
2017-09-23 02:13:19 +00:00
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'static T` does not outlive the data it points at
|
2017-11-20 12:13:27 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
|
2017-09-23 02:13:19 +00:00
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
29 | foo: &'static T
|
2017-09-23 02:13:19 +00:00
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
2017-10-01 15:15:15 +00:00
|
|
|
error[E0309]: the parameter type `K` may not live long enough
|
2017-11-20 12:13:27 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
|
2017-10-01 15:15:15 +00:00
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
33 | trait X<K>: Sized {
|
2017-10-02 08:43:36 +00:00
|
|
|
| - help: consider adding an explicit lifetime bound `K: 'a`...
|
2017-11-20 12:13:27 +00:00
|
|
|
34 | fn foo<'a, L: X<&'a Nested<K>>>();
|
2017-10-02 08:43:36 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
|
2017-11-20 12:13:27 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:34:5
|
2017-10-02 08:43:36 +00:00
|
|
|
|
|
2017-11-20 12:13:27 +00:00
|
|
|
34 | fn foo<'a, L: X<&'a Nested<K>>>();
|
2017-10-02 08:43:36 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0309]: the parameter type `Self` may not live long enough
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:38:5
|
2017-10-02 08:43:36 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
38 | fn bar<'a, L: X<&'a Nested<Self>>>();
|
2017-10-02 08:43:36 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider adding an explicit lifetime bound `Self: 'a`...
|
|
|
|
note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:38:5
|
2017-10-02 08:43:36 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
38 | fn bar<'a, L: X<&'a Nested<Self>>>();
|
2017-10-02 08:43:36 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
error[E0309]: the parameter type `L` may not live long enough
|
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:42:5
|
|
|
|
|
|
|
|
|
42 | fn baz<'a, L, M: X<&'a Nested<L>>>() {
|
|
|
|
| ^ - help: consider adding an explicit lifetime bound `L: 'a`...
|
|
|
|
| _____|
|
|
|
|
| |
|
|
|
|
43 | | //~^ ERROR may not live long enough
|
|
|
|
44 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
|
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:42:5
|
|
|
|
|
|
|
|
|
42 | / fn baz<'a, L, M: X<&'a Nested<L>>>() {
|
|
|
|
43 | | //~^ ERROR may not live long enough
|
|
|
|
44 | | }
|
|
|
|
| |_____^
|
|
|
|
|
2017-10-02 08:43:36 +00:00
|
|
|
error[E0309]: the parameter type `K` may not live long enough
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:51:5
|
2017-10-02 08:43:36 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
50 | impl<K> Nested<K> {
|
2017-10-01 15:15:15 +00:00
|
|
|
| - help: consider adding an explicit lifetime bound `K: 'a`...
|
2017-12-14 05:06:54 +00:00
|
|
|
51 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
|
|
|
|
52 | | //~^ ERROR may not live long enough
|
|
|
|
53 | | }
|
2017-10-01 15:15:15 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:51:5
|
2017-10-01 15:15:15 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
51 | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
|
|
|
|
52 | | //~^ ERROR may not live long enough
|
|
|
|
53 | | }
|
2017-10-01 15:15:15 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error[E0309]: the parameter type `M` may not live long enough
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:54:5
|
2017-10-01 15:15:15 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
54 | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
|
2017-10-01 15:15:15 +00:00
|
|
|
| ^ -- help: consider adding an explicit lifetime bound `M: 'a`...
|
|
|
|
| _____|
|
|
|
|
| |
|
2017-12-14 05:06:54 +00:00
|
|
|
55 | | //~^ ERROR may not live long enough
|
|
|
|
56 | | }
|
2017-10-01 15:15:15 +00:00
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
|
2017-12-14 05:06:54 +00:00
|
|
|
--> $DIR/lifetime-doesnt-live-long-enough.rs:54:5
|
2017-10-01 15:15:15 +00:00
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
54 | / fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
|
|
|
|
55 | | //~^ ERROR may not live long enough
|
|
|
|
56 | | }
|
2017-10-01 15:15:15 +00:00
|
|
|
| |_____^
|
|
|
|
|
2017-12-14 05:06:54 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2017-09-23 02:13:19 +00:00
|
|
|
|
2018-02-19 20:40:25 +00:00
|
|
|
You've got a few errors: E0309, E0310
|
|
|
|
If you want more information on an error, try using "rustc --explain E0309"
|