rust/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
2.7 KiB
Plaintext
Raw Normal View History

error[E0310]: the parameter type `T` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:19:10
|
2018-02-23 00:42:32 +00:00
LL | foo: &'static T
| ^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
2022-03-14 14:56:37 +00:00
|
help: consider adding an explicit lifetime bound...
|
LL | struct Foo<T: 'static> {
| +++++++++
2022-06-11 22:47:21 +00:00
error[E0309]: the parameter type `K` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
|
LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
|
help: consider adding an explicit lifetime bound...
|
LL | impl<K: 'a> Nested<K> {
| ++++
error[E0309]: the parameter type `M` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
|
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
|
help: consider adding an explicit lifetime bound...
|
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b + 'a>() {
| ++++
error[E0309]: the parameter type `K` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:24:19
|
2018-02-23 00:42:32 +00:00
LL | fn foo<'a, L: X<&'a Nested<K>>>();
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
2022-03-14 14:56:37 +00:00
|
help: consider adding an explicit lifetime bound...
|
LL | trait X<K: 'a>: Sized {
| ++++
2017-10-02 08:43:36 +00:00
error[E0309]: the parameter type `Self` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:28:19
2017-10-02 08:43:36 +00:00
|
2018-02-23 00:42:32 +00:00
LL | 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-10-02 08:43:36 +00:00
error[E0309]: the parameter type `L` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
|
LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
2022-03-14 14:56:37 +00:00
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
|
help: consider adding an explicit lifetime bound...
|
LL | fn baz<'a, L: 'a, M: X<&'a Nested<L>>>() {
| ++++
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0309, E0310.
2018-03-03 14:59:40 +00:00
For more information about an error, try `rustc --explain E0309`.