]> git.proxmox.com Git - rustc.git/blame - src/test/ui/self/elision/multiple-ref-self-async.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / self / elision / multiple-ref-self-async.rs
CommitLineData
e1599b0c
XL
1// check-pass
2// edition:2018
3
4#![feature(arbitrary_self_types)]
5#![allow(non_snake_case)]
6
7use std::marker::PhantomData;
8use std::ops::Deref;
9use std::pin::Pin;
10
11struct Struct { }
12
13struct Wrap<T, P>(T, PhantomData<P>);
14
15impl<T, P> Deref for Wrap<T, P> {
16 type Target = T;
17 fn deref(&self) -> &T { &self.0 }
18}
19
20impl Struct {
21 // Test using multiple `&Self`:
22
23 async fn wrap_ref_Self_ref_Self(self: Wrap<&Self, &Self>, f: &u8) -> &u8 {
24 f
25 }
26
27 async fn box_wrap_ref_Self_ref_Self(self: Box<Wrap<&Self, &Self>>, f: &u32) -> &u32 {
28 f
29 }
30
31 async fn pin_wrap_ref_Self_ref_Self(self: Pin<Wrap<&Self, &Self>>, f: &u32) -> &u32 {
32 f
33 }
34
35 async fn box_box_wrap_ref_Self_ref_Self(self: Box<Box<Wrap<&Self, &Self>>>, f: &u32) -> &u32 {
36 f
37 }
38
39 async fn box_pin_wrap_ref_Self_ref_Self(self: Box<Pin<Wrap<&Self, &Self>>>, f: &u32) -> &u32 {
40 f
41 }
42}
43
44fn main() { }