]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/elision/ref-struct.nll.stderr
Update const_forget.rs
[rust.git] / src / test / ui / self / elision / ref-struct.nll.stderr
1 error: lifetime may not live long enough
2   --> $DIR/ref-struct.rs:11:9
3    |
4 LL |     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`
8 LL |         f
9    |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
10
11 error: lifetime may not live long enough
12   --> $DIR/ref-struct.rs:15:9
13    |
14 LL |     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
15    |                                 -            - let's call the lifetime of this reference `'1`
16    |                                 |
17    |                                 let's call the lifetime of this reference `'2`
18 LL |         f
19    |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
20
21 error: lifetime may not live long enough
22   --> $DIR/ref-struct.rs:19:9
23    |
24 LL |     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
25    |                                 -            - let's call the lifetime of this reference `'1`
26    |                                 |
27    |                                 let's call the lifetime of this reference `'2`
28 LL |         f
29    |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
30
31 error: lifetime may not live long enough
32   --> $DIR/ref-struct.rs:23:9
33    |
34 LL |     fn box_box_ref_Struct(self: Box<Box<&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`
38 LL |         f
39    |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
40
41 error: lifetime may not live long enough
42   --> $DIR/ref-struct.rs:27:9
43    |
44 LL |     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
45    |                                     -             - let's call the lifetime of this reference `'1`
46    |                                     |
47    |                                     let's call the lifetime of this reference `'2`
48 LL |         f
49    |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
50
51 error: aborting due to 5 previous errors
52