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