Skip to content

Commit

Permalink
Rollup merge of #61818 - tmandry:issue-60709-test, r=cramertj
Browse files Browse the repository at this point in the history
Issue #60709 test

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

r? @cramertj
  • Loading branch information
Centril authored Jun 14, 2019
2 parents 9892367 + 0522b66 commit 9b91bec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
File renamed without changes.
28 changes: 28 additions & 0 deletions src/test/run-pass/async-await/issue-60709.rs
Original file line number Diff line number Diff line change
@@ -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<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.
}

0 comments on commit 9b91bec

Please sign in to comment.