From 40743efbc48977685bef1fdfdf9c93b147c022c9 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 13 Jun 2019 15:58:26 -0700 Subject: [PATCH 1/2] Add regression test for #60709 Closes #60709. --- src/test/run-pass/async-await/issue-60709.rs | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/run-pass/async-await/issue-60709.rs diff --git a/src/test/run-pass/async-await/issue-60709.rs b/src/test/run-pass/async-await/issue-60709.rs new file mode 100644 index 0000000000000..778d3ee0c7083 --- /dev/null +++ b/src/test/run-pass/async-await/issue-60709.rs @@ -0,0 +1,28 @@ +// 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 { + 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. +} From 0522b661a8e20a719d6e555088e547a2fd6fa602 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 13 Jun 2019 17:07:44 -0700 Subject: [PATCH 2/2] Move async-fn-size test to async-await/ --- src/test/run-pass/{ => async-await}/async-fn-size.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/test/run-pass/{ => async-await}/async-fn-size.rs (100%) diff --git a/src/test/run-pass/async-fn-size.rs b/src/test/run-pass/async-await/async-fn-size.rs similarity index 100% rename from src/test/run-pass/async-fn-size.rs rename to src/test/run-pass/async-await/async-fn-size.rs