about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/crashes/122587-1.rs5
-rw-r--r--tests/ui/consts/const_in_pattern/f16-f128-const-reassign.rs14
2 files changed, 14 insertions, 5 deletions
diff --git a/tests/crashes/122587-1.rs b/tests/crashes/122587-1.rs
deleted file mode 100644
index ea0e843a10c..00000000000
--- a/tests/crashes/122587-1.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-//@ known-bug: #122587
-const b: f16 = 0.0f16;
-pub fn main() {
-   let b = 0.0f16;
-}
diff --git a/tests/ui/consts/const_in_pattern/f16-f128-const-reassign.rs b/tests/ui/consts/const_in_pattern/f16-f128-const-reassign.rs
new file mode 100644
index 00000000000..99d0e472485
--- /dev/null
+++ b/tests/ui/consts/const_in_pattern/f16-f128-const-reassign.rs
@@ -0,0 +1,14 @@
+//@ check-pass
+// issue: rust-lang/rust#122587
+
+#![feature(f128)]
+#![feature(f16)]
+#![allow(non_upper_case_globals)]
+
+const h: f16 = 0.0f16;
+const q: f128 = 0.0f128;
+
+pub fn main() {
+    let h = 0.0f16 else { unreachable!() };
+    let q = 0.0f128 else { unreachable!() };
+}