Skip to content

Commit 65021ec

Browse files
committed
Add regression test for #60709
Closes #60709.
1 parent 433a467 commit 65021ec

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This used to compile the future down to ud2, due to uninhabited types being
2+
// handled incorrectly in generators.
3+
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
4+
5+
#![feature(async_await, await_macro)]
6+
#![allow(unused)]
7+
8+
use std::future::Future;
9+
use std::task::Poll;
10+
use std::task::Context;
11+
use std::pin::Pin;
12+
use std::rc::Rc;
13+
14+
struct Never();
15+
impl Future for Never {
16+
type Output = ();
17+
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
18+
Poll::Pending
19+
}
20+
}
21+
22+
fn main() {
23+
let fut = async {
24+
let _rc = Rc::new(()); // Also crashes with Arc
25+
await!(Never());
26+
};
27+
let _bla = fut; // Moving the future is required.
28+
}

0 commit comments

Comments
 (0)