about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-09-24 08:56:41 +0000
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-09-24 08:56:41 +0000
commitad7eb48ca9a3257e2ed10f5e9cf63cadbd34bc4f (patch)
tree49653fa8090760ea80f9a248cf96b33b3f0e0bf8
parent16a02664e66afbfcd738b600d4a409e809040695 (diff)
downloadrust-ad7eb48ca9a3257e2ed10f5e9cf63cadbd34bc4f.tar.gz
rust-ad7eb48ca9a3257e2ed10f5e9cf63cadbd34bc4f.zip
Add regression test for #130769
-rw-r--r--tests/ui/mir/early-otherwise-branch-ice.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/mir/early-otherwise-branch-ice.rs b/tests/ui/mir/early-otherwise-branch-ice.rs
new file mode 100644
index 00000000000..c1938eb7507
--- /dev/null
+++ b/tests/ui/mir/early-otherwise-branch-ice.rs
@@ -0,0 +1,18 @@
+// Changes in https://github.com/rust-lang/rust/pull/129047 lead to several mir-opt ICE regressions,
+// this test is added to make sure this does not regress.
+
+//@ compile-flags: -C opt-level=3
+//@ check-pass
+
+#![crate_type = "lib"]
+
+use std::task::Poll;
+
+pub fn poll(val: Poll<Result<Option<Vec<u8>>, u8>>) {
+    match val {
+        Poll::Ready(Ok(Some(_trailers))) => {}
+        Poll::Ready(Err(_err)) => {}
+        Poll::Ready(Ok(None)) => {}
+        Poll::Pending => {}
+    }
+}