fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
2.6 KiB77 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   |
12   = help: consider adding the following bound: `'b: 'a`
13
14error: lifetime may not live long enough
15  --> $DIR/wf-static-method.rs:26:18
16   |
17LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> {
18   |      --  -- lifetime `'b` defined here
19   |      |
20   |      lifetime `'a` defined here
21...
22LL |         let me = Self::make_me();
23   |                  ^^^^^^^^^^^^^ requires that `'b` must outlive `'a`
24   |
25   = help: consider adding the following bound: `'b: 'a`
26
27error: lifetime may not live long enough
28  --> $DIR/wf-static-method.rs:33:9
29   |
30LL | impl<'a, 'b> Evil<'a, 'b> {
31   |      --  -- lifetime `'b` defined here
32   |      |
33   |      lifetime `'a` defined here
34LL |     fn inherent_evil(u: &'b u32) -> &'a u32 {
35LL |         u
36   |         ^ returning this value requires that `'b` must outlive `'a`
37   |
38   = help: consider adding the following bound: `'b: 'a`
39
40error: lifetime may not live long enough
41  --> $DIR/wf-static-method.rs:41:5
42   |
43LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
44   |         --  -- lifetime `'b` defined here
45   |         |
46   |         lifetime `'a` defined here
47LL |     <()>::static_evil(b)
48   |     ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
49   |
50   = help: consider adding the following bound: `'b: 'a`
51
52error: lifetime may not live long enough
53  --> $DIR/wf-static-method.rs:45:5
54   |
55LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
56   |                  --  -- lifetime `'b` defined here
57   |                  |
58   |                  lifetime `'a` defined here
59LL |     <IndirectEvil>::static_evil(b)
60   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
61   |
62   = help: consider adding the following bound: `'b: 'a`
63
64error: lifetime may not live long enough
65  --> $DIR/wf-static-method.rs:50:5
66   |
67LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
68   |                  --  -- lifetime `'b` defined here
69   |                  |
70   |                  lifetime `'a` defined here
71LL |     <Evil>::inherent_evil(b) // bug? shouldn't this be an error
72   |     ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
73   |
74   = help: consider adding the following bound: `'b: 'a`
75
76error: aborting due to 6 previous errors
77