Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #60709 test #61818

Merged
merged 2 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// 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;
Expand Down
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.
}