fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
3.8 KiB109 linesraw
1error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2  --> $DIR/wf-static-method.rs:17:9
3   |
4LL |         u
5   |         ^
6   |
7note: ...the reference is valid for the lifetime `'a` as defined on the impl at 14:6...
8  --> $DIR/wf-static-method.rs:14:6
9   |
10LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
11   |      ^^
12note: ...but the borrowed content is only valid for the lifetime `'b` as defined on the impl at 14:10
13  --> $DIR/wf-static-method.rs:14:10
14   |
15LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
16   |          ^^
17
18error[E0478]: lifetime bound not satisfied
19  --> $DIR/wf-static-method.rs:26:18
20   |
21LL |         let me = Self::make_me();
22   |                  ^^^^^^^^^^^^^
23   |
24note: lifetime parameter instantiated with the lifetime `'b` as defined on the impl at 23:10
25  --> $DIR/wf-static-method.rs:23:10
26   |
27LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
28   |          ^^
29note: but lifetime parameter must outlive the lifetime `'a` as defined on the impl at 23:6
30  --> $DIR/wf-static-method.rs:23:6
31   |
32LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
33   |      ^^
34
35error[E0312]: lifetime of reference outlives lifetime of borrowed content...
36  --> $DIR/wf-static-method.rs:33:9
37   |
38LL |         u
39   |         ^
40   |
41note: ...the reference is valid for the lifetime `'a` as defined on the impl at 31:6...
42  --> $DIR/wf-static-method.rs:31:6
43   |
44LL | impl<'a, 'b> Evil<'a, 'b> {
45   |      ^^
46note: ...but the borrowed content is only valid for the lifetime `'b` as defined on the impl at 31:10
47  --> $DIR/wf-static-method.rs:31:10
48   |
49LL | impl<'a, 'b> Evil<'a, 'b> {
50   |          ^^
51
52error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
53  --> $DIR/wf-static-method.rs:41:5
54   |
55LL |     <()>::static_evil(b)
56   |     ^^^^^^^^^^^^^^^^^
57   |
58note: first, the lifetime cannot outlive the lifetime `'b` as defined on the function body at 40:13...
59  --> $DIR/wf-static-method.rs:40:13
60   |
61LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
62   |             ^^
63note: ...so that reference does not outlive borrowed content
64  --> $DIR/wf-static-method.rs:41:23
65   |
66LL |     <()>::static_evil(b)
67   |                       ^
68note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 40:9...
69  --> $DIR/wf-static-method.rs:40:9
70   |
71LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
72   |         ^^
73note: ...so that reference does not outlive borrowed content
74  --> $DIR/wf-static-method.rs:41:5
75   |
76LL |     <()>::static_evil(b)
77   |     ^^^^^^^^^^^^^^^^^^^^
78
79error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
80  --> $DIR/wf-static-method.rs:45:5
81   |
82LL |     <IndirectEvil>::static_evil(b)
83   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
84   |
85note: first, the lifetime cannot outlive the lifetime `'b` as defined on the function body at 44:22...
86  --> $DIR/wf-static-method.rs:44:22
87   |
88LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
89   |                      ^^
90note: ...so that reference does not outlive borrowed content
91  --> $DIR/wf-static-method.rs:45:33
92   |
93LL |     <IndirectEvil>::static_evil(b)
94   |                                 ^
95note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 44:18...
96  --> $DIR/wf-static-method.rs:44:18
97   |
98LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
99   |                  ^^
100note: ...so that reference does not outlive borrowed content
101  --> $DIR/wf-static-method.rs:45:5
102   |
103LL |     <IndirectEvil>::static_evil(b)
104   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105
106error: aborting due to 5 previous errors
107
108Some errors have detailed explanations: E0312, E0478, E0495.
109For more information about an error, try `rustc --explain E0312`.