]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/self/elision/ref-self-async.rs
3 #![allow(non_snake_case)]
5 use std
::marker
::PhantomData
;
11 struct Wrap
<T
, P
>(T
, PhantomData
<P
>);
13 impl<T
, P
> Deref
for Wrap
<T
, P
> {
15 fn deref(&self) -> &T { &self.0 }
19 // Test using `&self` sugar:
21 async
fn ref_self(&self, f
: &u32) -> &u32 {
22 f
//~ ERROR lifetime mismatch
25 // Test using `&Self` explicitly:
27 async
fn ref_Self(self: &Self, f
: &u32) -> &u32 {
28 f
//~ ERROR lifetime mismatch
31 async
fn box_ref_Self(self: Box
<&Self>, f
: &u32) -> &u32 {
32 f
//~ ERROR lifetime mismatch
35 async
fn pin_ref_Self(self: Pin
<&Self>, f
: &u32) -> &u32 {
36 f
//~ ERROR lifetime mismatch
39 async
fn box_box_ref_Self(self: Box
<Box
<&Self>>, f
: &u32) -> &u32 {
40 f
//~ ERROR lifetime mismatch
43 async
fn box_pin_ref_Self(self: Box
<Pin
<&Self>>, f
: &u32) -> &u32 {
44 f
//~ ERROR lifetime mismatch
47 async
fn wrap_ref_Self_Self(self: Wrap
<&Self, Self>, f
: &u8) -> &u8 {
48 f
//~ ERROR lifetime mismatch