We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c9e0610 + afcf01c commit fcb89b3Copy full SHA for fcb89b3
src/tools/miri/tests/pass/async-fn.rs
@@ -58,6 +58,21 @@ async fn hello_world() {
58
read_exact(&mut reader, &mut marker).await.unwrap();
59
}
60
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
76
fn run_fut<T>(fut: impl Future<Output = T>) -> T {
77
use std::task::{Context, Poll, Waker};
78
@@ -80,4 +95,5 @@ fn main() {
80
95
assert_eq!(run_fut(includes_never(false, 4)), 16);
81
96
assert_eq!(run_fut(partial_init(4)), 8);
82
97
run_fut(hello_world());
98
+ run_fut(uninhabited_variant());
83
99
0 commit comments