Find IntoFuture::IntoFuture's poll method

This commit is contained in:
Justin Ridgewell 2022-08-16 17:53:10 -04:00
parent dc3219bb11
commit cebf95718c
4 changed files with 65 additions and 10 deletions

View file

@ -1664,6 +1664,40 @@ fn f() {
);
}
#[test]
fn goto_await_into_future_poll() {
check(
r#"
//- minicore: future
struct Futurable;
impl core::future::IntoFuture for Futurable {
type IntoFuture = MyFut;
}
struct MyFut;
impl core::future::Future for MyFut {
type Output = ();
fn poll(
//^^^^
self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>
) -> std::task::Poll<Self::Output>
{
()
}
}
fn f() {
Futurable.await$0;
}
"#,
);
}
#[test]
fn goto_try_op() {
check(