summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
blob: affb4e8d04434d2a60042c7bd1830f4213af4d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
   |
help: consider adding an explicit lifetime bound...
   |
LL | struct Foo<T: 'static> {
   |             +++++++++

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
   |
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
   |
help: consider adding an explicit lifetime bound...
   |
LL | trait X<K: 'a>: Sized {
   |          ++++

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>>>();
   |                   ^^^^^^^^^^^^^^^^^^^
   |
   = 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

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
   |
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.
For more information about an error, try `rustc --explain E0309`.