diff --git a/src/tools/miri/tests/pass/uninhabited-coroutine-variant.rs b/src/tools/miri/tests/pass/uninhabited-coroutine-variant.rs new file mode 100644 index 0000000000000..1f42d3b0f919c --- /dev/null +++ b/src/tools/miri/tests/pass/uninhabited-coroutine-variant.rs @@ -0,0 +1,25 @@ +#![feature(noop_waker)] +use std::future::Future; + +enum Runtime {} + +async fn run(_: Runtime) {} + +async fn apply_timeout() { + let c = async {}; + match None:: { + None => { + c.await; + }, + Some(r) => { + run(r).await; + } + } +} + +fn main() { + let waker = std::task::Waker::noop(); + let mut ctx = std::task::Context::from_waker(&waker); + let fut = std::pin::pin!(apply_timeout()); + let _ = fut.poll(&mut ctx); +}