未验证 提交 2238a94b 编写于 作者: M Mazdak Farrokhzad 提交者: GitHub

Rollup merge of #61818 - tmandry:issue-60709-test, r=cramertj

Issue #60709 test

Adds a test for #60709, which was fixed as part of #59897.

r? @cramertj
// edition:2018
// aux-build:arc_wake.rs
#![feature(async_await, await_macro)]
extern crate arc_wake;
#[path = "../auxiliary/arc_wake.rs"]
mod arc_wake;
use std::pin::Pin;
use std::future::Future;
......
// This used to compile the future down to ud2, due to uninhabited types being
// handled incorrectly in generators.
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
#![feature(async_await, await_macro)]
#![allow(unused)]
use std::future::Future;
use std::task::Poll;
use std::task::Context;
use std::pin::Pin;
use std::rc::Rc;
struct Never();
impl Future for Never {
type Output = ();
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
Poll::Pending
}
}
fn main() {
let fut = async {
let _rc = Rc::new(()); // Also crashes with Arc
await!(Never());
};
let _bla = fut; // Moving the future is required.
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册