fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
2.2 KiB65 linesraw
1error: lifetime may not live long enough
2  --> $DIR/wf-static-method.rs:17:9
3   |
4LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
5   |      --  -- lifetime `'b` defined here
6   |      |
7   |      lifetime `'a` defined here
8...
9LL |         u
10   |         ^ returning this value requires that `'b` must outlive `'a`
11
12error: lifetime may not live long enough
13  --> $DIR/wf-static-method.rs:26:18
14   |
15LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
16   |      --  -- lifetime `'b` defined here
17   |      |
18   |      lifetime `'a` defined here
19...
20LL |         let me = Self::make_me();
21   |                  ^^^^^^^^^^^^^ requires that `'b` must outlive `'a`
22
23error: lifetime may not live long enough
24  --> $DIR/wf-static-method.rs:33:9
25   |
26LL | impl<'a, 'b> Evil<'a, 'b> {
27   |      --  -- lifetime `'b` defined here
28   |      |
29   |      lifetime `'a` defined here
30LL |     fn inherent_evil(u: &'b u32) -> &'a u32 {
31LL |         u
32   |         ^ returning this value requires that `'b` must outlive `'a`
33
34error: lifetime may not live long enough
35  --> $DIR/wf-static-method.rs:41:5
36   |
37LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
38   |         --  -- lifetime `'b` defined here
39   |         |
40   |         lifetime `'a` defined here
41LL |     <()>::static_evil(b)
42   |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
43
44error: lifetime may not live long enough
45  --> $DIR/wf-static-method.rs:45:5
46   |
47LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
48   |                  --  -- lifetime `'b` defined here
49   |                  |
50   |                  lifetime `'a` defined here
51LL |     <IndirectEvil>::static_evil(b)
52   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
53
54error: lifetime may not live long enough
55  --> $DIR/wf-static-method.rs:50:5
56   |
57LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
58   |                  --  -- lifetime `'b` defined here
59   |                  |
60   |                  lifetime `'a` defined here
61LL |     <Evil>::inherent_evil(b) // bug? shouldn't this be an error
62   |     ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
63
64error: aborting due to 6 previous errors
65