about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorltdk <usr@ltdk.xyz>2025-09-17 14:07:23 -0400
committerltdk <usr@ltdk.xyz>2025-09-21 20:37:51 -0400
commit055e05a338af00751ffccc992feeda227b8436b1 (patch)
tree7e15bddead7196bac2428f4d403826c8681bf29c /src
parent987f9603f9907bdcea9911517f216554f3c5cd4d (diff)
downloadrust-055e05a338af00751ffccc992feeda227b8436b1.tar.gz
rust-055e05a338af00751ffccc992feeda227b8436b1.zip
Mark float intrinsics with no preconditions as safe
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/float.rs4
-rw-r--r--src/tools/miri/tests/pass/intrinsics/fmuladd_nondeterministic.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs
index 9f1b3f612b2..323019df425 100644
--- a/src/tools/miri/tests/pass/float.rs
+++ b/src/tools/miri/tests/pass/float.rs
@@ -1401,12 +1401,12 @@ fn test_fmuladd() {
 
     #[inline(never)]
     pub fn test_operations_f32(a: f32, b: f32, c: f32) {
-        assert_approx_eq!(unsafe { fmuladdf32(a, b, c) }, a * b + c);
+        assert_approx_eq!(fmuladdf32(a, b, c), a * b + c);
     }
 
     #[inline(never)]
     pub fn test_operations_f64(a: f64, b: f64, c: f64) {
-        assert_approx_eq!(unsafe { fmuladdf64(a, b, c) }, a * b + c);
+        assert_approx_eq!(fmuladdf64(a, b, c), a * b + c);
     }
 
     test_operations_f32(0.1, 0.2, 0.3);
diff --git a/src/tools/miri/tests/pass/intrinsics/fmuladd_nondeterministic.rs b/src/tools/miri/tests/pass/intrinsics/fmuladd_nondeterministic.rs
index b688405c4b1..4d3e91c4cba 100644
--- a/src/tools/miri/tests/pass/intrinsics/fmuladd_nondeterministic.rs
+++ b/src/tools/miri/tests/pass/intrinsics/fmuladd_nondeterministic.rs
@@ -28,7 +28,7 @@ fn main() {
             let c = std::hint::black_box(-a * b);
             // It is unspecified whether the following operation is fused or not. The
             // following evaluates to 0.0 if unfused, and nonzero (-1.66e-18) if fused.
-            let x = unsafe { fmuladdf64(a, b, c) };
+            let x = fmuladdf64(a, b, c);
             x == 0.0
         }),
         "`fmuladdf64` failed to be evaluated as both fused and unfused"
@@ -41,7 +41,7 @@ fn main() {
             let c = std::hint::black_box(-a * b);
             // It is unspecified whether the following operation is fused or not. The
             // following evaluates to 0.0 if unfused, and nonzero (-8.1956386e-10) if fused.
-            let x = unsafe { fmuladdf32(a, b, c) };
+            let x = fmuladdf32(a, b, c);
             x == 0.0
         }),
         "`fmuladdf32` failed to be evaluated as both fused and unfused"