rust/library/std/src
Chris Denton e082bf341f
Rollup merge of #140323 - tgross35:cfg-unstable-float, r=Urgau
Implement the internal feature `cfg_target_has_reliable_f16_f128`

Support for `f16` and `f128` is varied across targets, backends, and backend versions. Eventually we would like to reach a point where all backends support these approximately equally, but until then we have to work around some of these nuances of support being observable.

Introduce the `cfg_target_has_reliable_f16_f128` internal feature, which provides the following new configuration gates:

* `cfg(target_has_reliable_f16)`
* `cfg(target_has_reliable_f16_math)`
* `cfg(target_has_reliable_f128)`
* `cfg(target_has_reliable_f128_math)`

`reliable_f16` and `reliable_f128` indicate that basic arithmetic for the type works correctly. The `_math` versions indicate that anything relying on `libm` works correctly, since sometimes this hits a separate class of codegen bugs.

These options match configuration set by the build script at [1]. The logic for LLVM support is duplicated as-is from the same script. There are a few possible updates that will come as a follow up.

The config introduced here is not planned to ever become stable, it is only intended to replace the build scripts for `std` tests and `compiler-builtins` that don't have any way to configure based on the codegen backend.

MCP: https://github.com/rust-lang/compiler-team/issues/866
Closes: https://github.com/rust-lang/compiler-team/issues/866

[1]: 555e1d0386/library/std/build.rs (L84-L186)

---

The second commit makes use of this config to replace `cfg_{f16,f128}{,_math}` in `library/`. I omitted providing a `cfg(bootstrap)` configuration to keep things simpler since the next beta branch is in two weeks.

try-job: aarch64-gnu
try-job: i686-msvc-1
try-job: test-various
try-job: x86_64-gnu
try-job: x86_64-msvc-ext2
2025-04-28 23:29:17 +00:00
..
backtrace remove redundant imports 2023-12-10 10:56:22 +08:00
collections Rollup merge of #139307 - xizheyin:issue-139296, r=joboet 2025-04-24 08:12:56 +02:00
ffi Rollup merge of #137439 - clarfonthey:c-str-module, r=tgross35 2025-04-27 11:54:56 +02:00
fs Test windows file type equality 2025-03-18 16:46:56 +00:00
hash remove const_hash feature leftovers 2024-11-02 11:27:14 +01:00
io use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
net ToSocketAddrs: fix typo 2025-04-04 14:47:04 +02:00
os use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
prelude Deprecate the unstable concat_idents! 2025-04-24 22:14:23 +00:00
process std: Apply deprecated_safe_2024 2025-02-13 13:10:28 -08:00
sync use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
sys Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, r=jdonszelmann,traviscross 2025-04-28 08:25:23 +00:00
sys_common Move fs into sys 2025-03-08 16:22:37 -08:00
thread use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
alloc.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
ascii.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
backtrace.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
bstr.rs Implement ByteStr and ByteString types 2025-01-11 06:35:21 +02:00
env.rs Move sys::pal::os::Env into sys::env 2025-04-21 20:56:43 -07:00
error.rs Move std::error unit tests to integration tests 2025-01-26 10:28:04 +00:00
f16.rs Use feature(target_has_reliable_f16_f128) in library tests 2025-04-27 20:10:33 +00:00
f32.rs std: make cmath functions safe 2025-03-29 13:08:18 +01:00
f64.rs std: make cmath functions safe 2025-03-29 13:08:18 +01:00
f128.rs Use feature(target_has_reliable_f16_f128) in library tests 2025-04-27 20:10:33 +00:00
fs.rs clarify std::fs::set_permissions symlink behavior 2025-04-08 15:07:08 -05:00
keyword_docs.rs Rollup merge of #140216 - t5kd:master, r=tgross35 2025-04-26 07:13:07 +02:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Auto merge of #136316 - GrigorenkoPV:generic_atomic, r=Mark-Simulacrum 2025-04-28 05:12:59 +00:00
macros.rs fix doc path in std::fmt macro 2025-02-25 09:08:22 +05:30
num.rs Move std::num unit tests to integration tests 2025-01-26 10:28:04 +00:00
panic.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
panicking.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
pat.rs Add pattern types to parser 2024-04-08 11:57:17 +00:00
path.rs Validate extension in PathBuf::add_extension 2025-04-22 05:34:25 -07:00
process.rs Rollup merge of #139554 - lolbinarycat:std-output-exit_ok, r=tgross35 2025-04-15 15:47:26 +10:00
random.rs Unify cygwin & horizon random impl 2025-03-10 21:23:32 +08:00
rt.rs rtprintpanic: clarify that the error is aborting the process 2025-04-18 15:02:22 +02:00
test_helpers.rs std: get rid of sys_common::io 2025-02-07 16:54:07 +01:00
time.rs Be more specific about the error in the SystemTime example 2025-04-17 11:57:28 -05:00