about summary refs log tree commit diff
path: root/tests/ui/methods/inherent-method-resolution-on-deref-type-53843.rs
blob: 0b2ab9afc399eec63177bce88cdf95dad1a19691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//@ run-pass

use std::ops::Deref;

pub struct Pin<P>(P);

impl<P, T> Deref for Pin<P>
where
    P: Deref<Target=T>,
{
    type Target = T;

    fn deref(&self) -> &T {
        &*self.0
    }
}

impl<P> Pin<P> {
    fn poll(self) {}
}

fn main() {
    let mut unit = ();
    let pin = Pin(&mut unit);
    pin.poll();
}

// https://github.com/rust-lang/rust/issues/53843