diff options
Diffstat (limited to 'tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr')
-rw-r--r-- | tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr b/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr index affb4e8d0..235092e24 100644 --- a/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr +++ b/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr @@ -2,9 +2,12 @@ error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:19:10 | LL | foo: &'static T - | ^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at + | ^^^^^^^^^^ + | | + | the parameter type `T` must be valid for the static lifetime... + | ...so that the reference type `&'static T` does not outlive the data it points at | -help: consider adding an explicit lifetime bound... +help: consider adding an explicit lifetime bound | LL | struct Foo<T: 'static> { | +++++++++ @@ -13,20 +16,24 @@ 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 + | -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at + | | + | the parameter type `K` must be valid for the lifetime `'a` as defined here... | -help: consider adding an explicit lifetime bound... +help: consider adding an explicit lifetime bound | -LL | impl<K: 'a> Nested<K> { - | ++++ +LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() where K: 'a { + | +++++++++++ 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 + | -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<M>` does not outlive the data it points at + | | + | the parameter type `M` must be valid for the lifetime `'a` as defined here... | -help: consider adding an explicit lifetime bound... +help: consider adding an explicit lifetime bound | LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b + 'a>() { | ++++ @@ -35,29 +42,37 @@ error[E0309]: the parameter type `K` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:24:19 | 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 + | -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at + | | + | the parameter type `K` must be valid for the lifetime `'a` as defined here... | -help: consider adding an explicit lifetime bound... +help: consider adding an explicit lifetime bound | -LL | trait X<K: 'a>: Sized { - | ++++ +LL | fn foo<'a, L: X<&'a Nested<K>>>() where K: 'a; + | +++++++++++ error[E0309]: the parameter type `Self` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:19 | LL | fn bar<'a, L: X<&'a Nested<Self>>>(); - | ^^^^^^^^^^^^^^^^^^^ + | -- ^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at + | | + | the parameter type `Self` must be valid for the lifetime `'a` as defined here... | - = 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 +help: consider adding an explicit lifetime bound + | +LL | fn bar<'a, L: X<&'a Nested<Self>>>() where Self: 'a; + | ++++++++++++++ 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>>>() { - | ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at + | -- ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at + | | + | the parameter type `L` must be valid for the lifetime `'a` as defined here... | -help: consider adding an explicit lifetime bound... +help: consider adding an explicit lifetime bound | LL | fn baz<'a, L: 'a, M: X<&'a Nested<L>>>() { | ++++ |