rust/library/coretests/tests
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
..
async_iter Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi add CStr::display 2025-05-24 08:24:52 -04:00
floats Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung 2025-06-09 21:21:58 +00:00
fmt Auto merge of #136974 - m-ou-se:fmt-options-64-bit, r=scottmcm 2025-03-22 10:56:14 +00:00
hash library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
io Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
iter added test for Enumerate::next_index on empty iterator 2025-04-19 12:29:47 +02:00
net Recognise new IPv6 non-global range from RFC9602 2025-03-21 17:53:29 +11:00
num Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJung 2025-06-09 21:21:58 +00:00
ops Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
alloc.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
any.rs Optionally add type names to TypeIds. 2025-02-11 18:42:19 -08:00
array.rs Add #[must_use] to Array::map 2025-05-13 12:34:53 +09:00
ascii.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii_char.rs Implement Extend<AsciiChar> for String 2025-02-08 16:51:04 -05:00
asserting.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
atomic.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
bool.rs Remove some unnecessary parens in assert! conditions 2025-02-06 22:28:44 +00:00
bstr.rs Actually run the bstr test 2025-01-26 10:45:09 +00:00
cell.rs Apply requested API changes to cell_update 2025-04-02 18:18:50 +00:00
char.rs add MAX_LEN_UTF8 and MAX_LEN_UTF16 constants 2025-02-16 21:08:38 +08:00
clone.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
cmp.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
const_ptr.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
convert.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
error.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
future.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
hint.rs Fix drop handling in hint::select_unpredictable 2025-04-17 17:30:53 +02:00
intrinsics.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lazy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lib.rs add tests 2025-06-02 22:57:16 -04:00
macros.rs Rename cfg_match! to cfg_select! 2025-05-20 21:16:23 +00:00
manually_drop.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
mem.rs Add inherent versions of MaybeUninit::fill methods for slices 2025-03-08 18:41:35 -05:00
nonzero.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
ops.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
option.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pattern.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pin.rs Put pin!() tests in the right file. 2025-03-28 10:18:04 +01:00
pin_macro.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
ptr.rs stabilize ptr::swap_nonoverlapping in const 2025-04-29 10:40:56 +02:00
result.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
simd.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
slice.rs Rollup merge of #138034 - thaliaarchi:use-prelude-size-of, r=tgross35 2025-03-07 10:12:44 +01:00
str.rs tidy: Fix paths to coretests and alloctests 2025-04-05 12:15:49 -07:00
str_lossy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
task.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
time.rs Split duration_constructors to get non-controversial bits out faster. 2025-05-09 22:52:39 -04:00
tuple.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
unicode.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
waker.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00