Skip to content

Commit fcb89b3

Browse files
committed
Auto merge of #3226 - saethlin:deadpool-test, r=RalfJung
Add a regression test for rust#115145 Per #118805 (comment)
2 parents c9e0610 + afcf01c commit fcb89b3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/tools/miri/tests/pass/async-fn.rs

+16
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ async fn hello_world() {
5858
read_exact(&mut reader, &mut marker).await.unwrap();
5959
}
6060

61+
// This example comes from https://github.com/rust-lang/rust/issues/115145
62+
async fn uninhabited_variant() {
63+
async fn unreachable(_: Never) {}
64+
65+
let c = async {};
66+
match None::<Never> {
67+
None => {
68+
c.await;
69+
}
70+
Some(r) => {
71+
unreachable(r).await;
72+
}
73+
}
74+
}
75+
6176
fn run_fut<T>(fut: impl Future<Output = T>) -> T {
6277
use std::task::{Context, Poll, Waker};
6378

@@ -80,4 +95,5 @@ fn main() {
8095
assert_eq!(run_fut(includes_never(false, 4)), 16);
8196
assert_eq!(run_fut(partial_init(4)), 8);
8297
run_fut(hello_world());
98+
run_fut(uninhabited_variant());
8399
}

0 commit comments

Comments
 (0)