rust/library
bors c6768de2d6 Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung
Enable Non-determinism of float operations in Miri and change std tests

Links to [#4208](https://github.com/rust-lang/miri/issues/4208) and [#3555](https://github.com/rust-lang/miri/issues/3555) in Miri.

Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them.

This pr includes the following changes:

- Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP
- These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [#4286](https://github.com/rust-lang/miri/issues/4286#issue-3010677983)
- Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`.
- Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds`
- Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed.
- Added tests in the float tests of Miri to test the C23 behaviour.

Fixes https://github.com/rust-lang/miri/issues/4208
2025-06-09 21:21:58 +00:00
..
alloc Rollup merge of #142238 - RalfJung:nonnull_provenance, r=workingjubilee 2025-06-09 12:17:55 -05:00
alloctests stabilize nonnull_provenance 2025-06-09 12:36:24 +02:00
backtrace@6c882eb119 Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
compiler-builtins compiler-builtins: Emit rustc-check-cfg earlier 2025-06-09 04:46:54 +00:00
core Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung 2025-06-09 21:21:58 +00:00
coretests Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung 2025-06-09 21:21:58 +00:00
panic_abort Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00
panic_unwind Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3 2025-06-09 12:17:53 -05:00
portable-simd Merge commit 'c14f2fc3eb' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro Do not get proc_macro from the sysroot in rustc 2025-05-27 15:49:28 +00:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Revert changes for rtstartup 2025-03-10 21:23:31 +08:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung 2025-06-09 21:21:58 +00:00
stdarch@5c1c436524 Update stdarch submodule 2025-06-03 18:54:56 +05:30
sysroot Update stdarch 2025-05-01 20:01:43 +05:30
test Add new test_main_with_exit_callback public function in libtest to allow a callback to be called before exiting 2025-05-06 18:17:48 +02:00
unwind Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3 2025-06-09 12:17:53 -05:00
windows_targets Fix backtrace for cygwin 2025-05-07 13:08:19 +08:00
Cargo.lock Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00
Cargo.toml Use the in-tree compiler-builtins 2025-06-08 02:36:58 +00:00