]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/self/elision/ref-self-async.rs
3 #![allow(non_snake_case)]
4 #![feature(arbitrary_self_types)]
6 use std
::marker
::PhantomData
;
12 struct Wrap
<T
, P
>(T
, PhantomData
<P
>);
14 impl<T
, P
> Deref
for Wrap
<T
, P
> {
16 fn deref(&self) -> &T { &self.0 }
20 // Test using `&self` sugar:
22 async
fn ref_self(&self, f
: &u32) -> &u32 {
23 f
//~ ERROR lifetime mismatch
26 // Test using `&Self` explicitly:
28 async
fn ref_Self(self: &Self, f
: &u32) -> &u32 {
29 f
//~ ERROR lifetime mismatch
32 async
fn box_ref_Self(self: Box
<&Self>, f
: &u32) -> &u32 {
33 f
//~ ERROR lifetime mismatch
36 async
fn pin_ref_Self(self: Pin
<&Self>, f
: &u32) -> &u32 {
37 f
//~ ERROR lifetime mismatch
40 async
fn box_box_ref_Self(self: Box
<Box
<&Self>>, f
: &u32) -> &u32 {
41 f
//~ ERROR lifetime mismatch
44 async
fn box_pin_ref_Self(self: Box
<Pin
<&Self>>, f
: &u32) -> &u32 {
45 f
//~ ERROR lifetime mismatch
48 async
fn wrap_ref_Self_Self(self: Wrap
<&Self, Self>, f
: &u8) -> &u8 {
49 f
//~ ERROR lifetime mismatch