]>
Commit | Line | Data |
---|---|---|
dc9dc135 XL |
1 | #![allow(non_snake_case)] |
2 | ||
3 | use std::pin::Pin; | |
4 | ||
5 | struct Struct { } | |
6 | ||
7 | impl Struct { | |
8 | // Test using `&Struct` explicitly: | |
9 | ||
10 | fn ref_Struct(self: &Struct, f: &u32) -> &u32 { | |
04454e1e | 11 | f |
923072b8 | 12 | //~^ ERROR lifetime may not live long enough |
dc9dc135 XL |
13 | } |
14 | ||
15 | fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 { | |
04454e1e | 16 | f |
923072b8 | 17 | //~^ ERROR lifetime may not live long enough |
dc9dc135 XL |
18 | } |
19 | ||
20 | fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 { | |
04454e1e | 21 | f |
923072b8 | 22 | //~^ ERROR lifetime may not live long enough |
dc9dc135 XL |
23 | } |
24 | ||
25 | fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 { | |
04454e1e | 26 | f |
923072b8 | 27 | //~^ ERROR lifetime may not live long enough |
dc9dc135 XL |
28 | } |
29 | ||
30 | fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 { | |
04454e1e | 31 | f |
923072b8 | 32 | //~^ ERROR lifetime may not live long enough |
dc9dc135 XL |
33 | } |
34 | } | |
35 | ||
36 | fn main() { } |