]> git.proxmox.com Git - rustc.git/blob - src/test/ui/self/elision/ref-assoc.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / self / elision / ref-assoc.rs
1 // check-pass
2
3 #![allow(non_snake_case)]
4
5 use std::pin::Pin;
6
7 trait Trait {
8 type AssocType;
9 }
10
11 struct Struct { }
12
13 impl Trait for Struct {
14 type AssocType = Self;
15 }
16
17 impl Struct {
18 fn ref_AssocType(self: &<Struct as Trait>::AssocType, f: &u32) -> &u32 {
19 f
20 }
21
22 fn box_ref_AssocType(self: Box<&<Struct as Trait>::AssocType>, f: &u32) -> &u32 {
23 f
24 }
25
26 fn pin_ref_AssocType(self: Pin<&<Struct as Trait>::AssocType>, f: &u32) -> &u32 {
27 f
28 }
29
30 fn box_box_ref_AssocType(self: Box<Box<&<Struct as Trait>::AssocType>>, f: &u32) -> &u32 {
31 f
32 }
33
34 fn box_pin_ref_AssocType(self: Box<Pin<&<Struct as Trait>::AssocType>>, f: &u32) -> &u32 {
35 f
36 }
37 }
38
39 fn main() { }