]>
Commit | Line | Data |
---|---|---|
e1599b0c XL |
1 | // check-pass |
2 | // edition:2018 | |
3 | ||
4 | #![feature(arbitrary_self_types)] | |
5 | #![allow(non_snake_case)] | |
6 | ||
7 | use std::marker::PhantomData; | |
8 | use std::ops::Deref; | |
9 | use std::pin::Pin; | |
10 | ||
11 | struct Struct { } | |
12 | ||
13 | struct Wrap<T, P>(T, PhantomData<P>); | |
14 | ||
15 | impl<T, P> Deref for Wrap<T, P> { | |
16 | type Target = T; | |
17 | fn deref(&self) -> &T { &self.0 } | |
18 | } | |
19 | ||
20 | impl 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 | ||
44 | fn main() { } |