]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/elision/ref-mut-struct.rs
Make it more clear when complaining about async fn's return types
[rust.git] / src / test / ui / self / elision / ref-mut-struct.rs
1 #![allow(non_snake_case)]
2
3 use std::pin::Pin;
4
5 struct Struct { }
6
7 impl Struct {
8     // Test using `&mut Struct` explicitly:
9
10     fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
11         f //~ ERROR lifetime mismatch
12     }
13
14     fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
15         f //~ ERROR lifetime mismatch
16     }
17
18     fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
19         f //~ ERROR lifetime mismatch
20     }
21
22     fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
23         f //~ ERROR lifetime mismatch
24     }
25
26     fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
27         f //~ ERROR lifetime mismatch
28     }
29 }
30
31 fn main() { }