Closed
Description
Using rustc 1.36.0-nightly (3991285 2019-04-25), the following test compiles to ud2
, when using the following command: rustc --edition=2018 -Copt-level=z -Cdebuginfo=2 --test test.rs -o test
. Both the opt-level
and debuginfo
are necessary to get ud2
.
#![feature(async_await, await_macro)]
#![allow(unused)]
#[cfg(test)]
mod tests {
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
}
}
#[test]
fn crashing_test() {
let fut = async {
let _rc = Rc::new(()); // Also crashes with Arc
await!(Never());
};
let _bla = fut; // Moving the future is required.
}
}