]> git.proxmox.com Git - rustc.git/blob - src/test/ui/self/elision/ref-mut-struct-async.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / self / elision / ref-mut-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 `&mut Struct` explicitly:
11
12 async fn ref_Struct(self: &mut Struct, f: &u32) -> &u32 {
13 f //~ ERROR lifetime mismatch
14 }
15
16 async fn box_ref_Struct(self: Box<&mut Struct>, f: &u32) -> &u32 {
17 f //~ ERROR lifetime mismatch
18 }
19
20 async fn pin_ref_Struct(self: Pin<&mut Struct>, f: &u32) -> &u32 {
21 f //~ ERROR lifetime mismatch
22 }
23
24 async fn box_box_ref_Struct(self: Box<Box<&mut Struct>>, f: &u32) -> &u32 {
25 f //~ ERROR lifetime mismatch
26 }
27
28 async fn box_pin_ref_Struct(self: Box<Pin<&mut Struct>>, f: &u32) -> &u32 {
29 f //~ ERROR lifetime mismatch
30 }
31 }
32
33 fn main() { }