]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/elision/ref-struct.rs
Rollup merge of #63055 - Mark-Simulacrum:save-analysis-clean-2, r=Xanewok
[rust.git] / src / test / ui / self / elision / ref-struct.rs
1 #![feature(arbitrary_self_types)]
2 #![allow(non_snake_case)]
3
4 use std::pin::Pin;
5
6 struct Struct { }
7
8 impl Struct {
9     // Test using `&Struct` explicitly:
10
11     fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
12         f //~ ERROR lifetime mismatch
13     }
14
15     fn box_ref_Struct(self: Box<&Struct>, f: &u32) -> &u32 {
16         f //~ ERROR lifetime mismatch
17     }
18
19     fn pin_ref_Struct(self: Pin<&Struct>, f: &u32) -> &u32 {
20         f //~ ERROR lifetime mismatch
21     }
22
23     fn box_box_ref_Struct(self: Box<Box<&Struct>>, f: &u32) -> &u32 {
24         f //~ ERROR lifetime mismatch
25     }
26
27     fn box_pin_Struct(self: Box<Pin<&Struct>>, f: &u32) -> &u32 {
28         f //~ ERROR lifetime mismatch
29     }
30 }
31
32 fn main() { }