2019-06-13 17:58:26 -05:00
|
|
|
// This used to compile the future down to ud2, due to uninhabited types being
|
2023-10-19 16:46:28 -05:00
|
|
|
// handled incorrectly in coroutines.
|
2019-06-13 17:58:26 -05:00
|
|
|
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
|
|
|
|
|
2019-07-01 09:18:45 -05:00
|
|
|
// run-pass
|
2019-08-17 00:08:01 -05:00
|
|
|
// ignore-asmjs wasm2js does not support source maps yet
|
2019-07-01 09:18:45 -05:00
|
|
|
|
2019-06-13 17:58:26 -05:00
|
|
|
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
|
2019-07-03 17:25:14 -05:00
|
|
|
Never().await;
|
2019-06-13 17:58:26 -05:00
|
|
|
};
|
|
|
|
let _bla = fut; // Moving the future is required.
|
|
|
|
}
|