Skip to content

Commit 7372132

Browse files
authored
Rollup merge of rust-lang#146051 - LorrensP-2158466:miri-libstd-fix, r=RalfJung
Change std f32 test to pass under Miri Adds `APPROX_DELTA` to 2 tests of `f32::log` reported in [#miri > Miri test-libstd Failure (2025-08)](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-08.29). I changed 2 lines, the first one is the actual failure. The second one is precautionary.
2 parents 6fa6894 + cfba491 commit 7372132

File tree

1 file changed

+2
-2
lines changed
  • library/std/tests/floats

1 file changed

+2
-2
lines changed

library/std/tests/floats/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ fn test_log() {
7979
let nan: f32 = f32::NAN;
8080
let inf: f32 = f32::INFINITY;
8181
let neg_inf: f32 = f32::NEG_INFINITY;
82-
assert_approx_eq!(10.0f32.log(10.0), 1.0);
83-
assert_approx_eq!(2.3f32.log(3.5), 0.664858);
82+
assert_approx_eq!(10.0f32.log(10.0), 1.0, APPROX_DELTA);
83+
assert_approx_eq!(2.3f32.log(3.5), 0.664858, APPROX_DELTA);
8484
assert_approx_eq!(1.0f32.exp().log(1.0f32.exp()), 1.0, APPROX_DELTA);
8585
assert!(1.0f32.log(1.0).is_nan());
8686
assert!(1.0f32.log(-13.9).is_nan());

0 commit comments

Comments
 (0)