Skip to content

Commit b02c9ef

Browse files
committed
Add the test minimized from deadpool
1 parent 9daa30e commit b02c9ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/pass/async-fn.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ async fn hello_world() {
5858
read_exact(&mut reader, &mut marker).await.unwrap();
5959
}
6060

61+
async fn uninhabited_variant() {
62+
async fn unreachable(_: Never) {}
63+
64+
let c = async {};
65+
match None::<Never> {
66+
None => {
67+
c.await;
68+
}
69+
Some(r) => {
70+
unreachable(r).await;
71+
}
72+
}
73+
}
74+
6175
fn run_fut<T>(fut: impl Future<Output = T>) -> T {
6276
use std::task::{Context, Poll, Waker};
6377

@@ -80,4 +94,5 @@ fn main() {
8094
assert_eq!(run_fut(includes_never(false, 4)), 16);
8195
assert_eq!(run_fut(partial_init(4)), 8);
8296
run_fut(hello_world());
97+
run_fut(uninhabited_variant());
8398
}

0 commit comments

Comments
 (0)