about summary refs log tree commit diff
path: root/tests/ui/async-await/pin-needed-to-poll-3.rs
blob: 11ba7d29abaf95669cacadc634fa6b50b53b7d5a (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
use std::{
    future::Future,
    pin::Pin,
    task::{Context, Poll},
};


struct FutureWrapper<F> {
    fut: F,
}

impl<F> Future for FutureWrapper<F>
where
    F: Future,
{
    type Output = F::Output;

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        let res = self.fut.poll(cx);
        //~^ ERROR no method named `poll` found for type parameter `F` in the current scope
        res
    }
}

fn main() {}