Skip to content

Commit

Permalink
Add a regression test for rust-lang#115145
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Dec 14, 2023
1 parent e6d1b0e commit ace1fa8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/tools/miri/tests/pass/uninhabited-coroutine-variant.rs
Original file line number Diff line number Diff line change
@@ -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::<Runtime> {
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);
}

0 comments on commit ace1fa8

Please sign in to comment.