fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.6 KiB77 linesraw
1error: lifetime may not live long enough
2  --> $DIR/ref-struct.rs:11:9
3   |
4LL |     fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
5   |                         -           - let's call the lifetime of this reference `'1`
6   |                         |
7   |                         let's call the lifetime of this reference `'2`
8LL |         f
9   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
10   |
11help: consider introducing a named lifetime parameter and update trait if needed
12   |
13LL |     fn ref_Struct<'a>(self: &'a Struct, f: &'a u32) -> &u32 {
14   |                  ++++        ++             ++
15
16error: lifetime may not live long enough
17  --> $DIR/ref-struct.rs:16:9
18   |
19LL |     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
20   |                                 -            - let's call the lifetime of this reference `'1`
21   |                                 |
22   |                                 let's call the lifetime of this reference `'2`
23LL |         f
24   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
25   |
26help: consider introducing a named lifetime parameter and update trait if needed
27   |
28LL |     fn box_ref_Struct<'a>(self: Box<&'a Struct>, f: &'a u32) -> &u32 {
29   |                      ++++            ++              ++
30
31error: lifetime may not live long enough
32  --> $DIR/ref-struct.rs:21:9
33   |
34LL |     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
35   |                                 -            - let's call the lifetime of this reference `'1`
36   |                                 |
37   |                                 let's call the lifetime of this reference `'2`
38LL |         f
39   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
40   |
41help: consider introducing a named lifetime parameter and update trait if needed
42   |
43LL |     fn pin_ref_Struct<'a>(self: Pin<&'a Struct>, f: &'a u32) -> &u32 {
44   |                      ++++            ++              ++
45
46error: lifetime may not live long enough
47  --> $DIR/ref-struct.rs:26:9
48   |
49LL |     fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
50   |                                         -             - let's call the lifetime of this reference `'1`
51   |                                         |
52   |                                         let's call the lifetime of this reference `'2`
53LL |         f
54   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
55   |
56help: consider introducing a named lifetime parameter and update trait if needed
57   |
58LL |     fn box_box_ref_Struct<'a>(self: Box<Box<&'a Struct>>, f: &'a u32) -> &u32 {
59   |                          ++++                ++               ++
60
61error: lifetime may not live long enough
62  --> $DIR/ref-struct.rs:31:9
63   |
64LL |     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
65   |                                     -             - let's call the lifetime of this reference `'1`
66   |                                     |
67   |                                     let's call the lifetime of this reference `'2`
68LL |         f
69   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
70   |
71help: consider introducing a named lifetime parameter and update trait if needed
72   |
73LL |     fn box_pin_Struct<'a>(self: Box<Pin<&'a Struct>>, f: &'a u32) -> &u32 {
74   |                      ++++                ++               ++
75
76error: aborting due to 5 previous errors
77