2024-02-16 14:02:50 -06:00
|
|
|
//@ edition: 2021
|
|
|
|
//@ run-rustfix
|
2023-08-09 07:31:36 -05:00
|
|
|
#![allow(unused_must_use, dead_code)]
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
fn foo() -> impl Future<Output=()> {
|
|
|
|
async { }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(cx: &mut std::task::Context<'_>) {
|
|
|
|
let fut = foo();
|
|
|
|
let mut pinned = std::pin::pin!(fut);
|
|
|
|
pinned.as_mut().poll(cx);
|
|
|
|
//~^ ERROR no method named `poll` found for opaque type `impl Future<Output = ()>` in the current scope [E0599]
|
|
|
|
}
|
|
|
|
fn main() {}
|