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