]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
d682478db0eeff8b302d2e0f9e54e44ffb3f3193
[rust.git] / src / test / ui / lifetimes / lifetime-doesnt-live-long-enough.stderr
1 error[E0310]: the parameter type `T` may not live long enough
2   --> $DIR/lifetime-doesnt-live-long-enough.rs:19:5
3    |
4 LL | struct Foo<T> {
5    |            - help: consider adding an explicit lifetime bound...: `T: 'static`
6 LL |     foo: &'static T
7    |     ^^^^^^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
8
9 error[E0309]: the parameter type `K` may not live long enough
10   --> $DIR/lifetime-doesnt-live-long-enough.rs:24:19
11    |
12 LL | trait X<K>: Sized {
13    |         - help: consider adding an explicit lifetime bound...: `K: 'a`
14 LL |     fn foo<'a, L: X<&'a Nested<K>>>();
15    |                   ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
16
17 error[E0309]: the parameter type `Self` may not live long enough
18   --> $DIR/lifetime-doesnt-live-long-enough.rs:28:19
19    |
20 LL |     fn bar<'a, L: X<&'a Nested<Self>>>();
21    |                   ^^^^^^^^^^^^^^^^^^^
22    |
23    = help: consider adding an explicit lifetime bound `Self: 'a`...
24    = note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
25
26 error[E0309]: the parameter type `L` may not live long enough
27   --> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
28    |
29 LL |     fn baz<'a, L, M: X<&'a Nested<L>>>() {
30    |                -     ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
31    |                |
32    |                help: consider adding an explicit lifetime bound...: `L: 'a`
33
34 error[E0309]: the parameter type `K` may not live long enough
35   --> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
36    |
37 LL | impl<K> Nested<K> {
38    |      - help: consider adding an explicit lifetime bound...: `K: 'a`
39 LL |     fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
40    |                                 ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
41
42 error[E0309]: the parameter type `M` may not live long enough
43   --> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
44    |
45 LL |     fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
46    |                                    ^^^^^^^^^^^^^^^^  -- help: consider adding an explicit lifetime bound...: `M: 'a +`
47    |                                    |
48    |                                    ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
49
50 error: aborting due to 6 previous errors
51
52 Some errors have detailed explanations: E0309, E0310.
53 For more information about an error, try `rustc --explain E0309`.