We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9daa30e commit b02c9efCopy full SHA for b02c9ef
tests/pass/async-fn.rs
@@ -58,6 +58,20 @@ async fn hello_world() {
58
read_exact(&mut reader, &mut marker).await.unwrap();
59
}
60
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
75
fn run_fut<T>(fut: impl Future<Output = T>) -> T {
76
use std::task::{Context, Poll, Waker};
77
@@ -80,4 +94,5 @@ fn main() {
80
94
assert_eq!(run_fut(includes_never(false, 4)), 16);
81
95
assert_eq!(run_fut(partial_init(4)), 8);
82
96
run_fut(hello_world());
97
+ run_fut(uninhabited_variant());
83
98
0 commit comments