From 9c44b60b3a05b5f3e8e8b906bb48eaf27f1fa9e9 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 21 Jun 2024 03:51:11 -0400 Subject: [PATCH] Change a fixed crash test to a standard test Fixes --- tests/crashes/122587-1.rs | 5 ----- .../const_in_pattern/f16-f128-const-reassign.rs | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 tests/crashes/122587-1.rs create mode 100644 tests/ui/consts/const_in_pattern/f16-f128-const-reassign.rs diff --git a/tests/crashes/122587-1.rs b/tests/crashes/122587-1.rs deleted file mode 100644 index ea0e843a10cea..0000000000000 --- 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 0000000000000..99d0e47248576 --- /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!() }; +}