diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-01 12:42:28 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-01 12:42:28 +1000 |
| commit | 0dbd8e68b129ca35df99eae7bc824f26d5098336 (patch) | |
| tree | 6a95dad752159ccb9e52093aaefb484f365e1baf | |
| parent | eed52596abf7cbe2af47b18da52ae0567640bc51 (diff) | |
| parent | cfba491e674dcff8cc5edbf9ae3e3880518804fd (diff) | |
| download | rust-0dbd8e68b129ca35df99eae7bc824f26d5098336.tar.gz rust-0dbd8e68b129ca35df99eae7bc824f26d5098336.zip | |
Rollup merge of #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.
| -rw-r--r-- | library/std/tests/floats/f32.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/tests/floats/f32.rs b/library/std/tests/floats/f32.rs index 38c906c1d87..c61a8ec4d20 100644 --- a/library/std/tests/floats/f32.rs +++ b/library/std/tests/floats/f32.rs @@ -79,8 +79,8 @@ fn test_log() { let nan: f32 = f32::NAN; let inf: f32 = f32::INFINITY; let neg_inf: f32 = f32::NEG_INFINITY; - assert_approx_eq!(10.0f32.log(10.0), 1.0); - assert_approx_eq!(2.3f32.log(3.5), 0.664858); + assert_approx_eq!(10.0f32.log(10.0), 1.0, APPROX_DELTA); + assert_approx_eq!(2.3f32.log(3.5), 0.664858, APPROX_DELTA); assert_approx_eq!(1.0f32.exp().log(1.0f32.exp()), 1.0, APPROX_DELTA); assert!(1.0f32.log(1.0).is_nan()); assert!(1.0f32.log(-13.9).is_nan()); |
