rust/library/std/src/sys
Chris Denton 709f4fee50
Rollup merge of #139868 - thaliaarchi:move-env-consts-pal, r=joboet
Move `pal::env` to `std::sys::env_consts`

Combine the `std::env::consts` platform implementations as a single file. Use the Unix file as the base, since it has 28 entries, and fold the 8 singleton platforms into it. The Unix file was roughly grouped into Linux, Apple, BSD, and everything else, roughly in alphabetical order. Alphabetically order them to make it easier to maintain and discard the Unix-specific groups to generalize it to all platforms.

I'd prefer to have no fallback implementation, as I consider it a bug; however TEEOS, Trusty, and Xous have no definitions here. Since they otherwise have `pal` abstractions, that indicates that there are several platforms without `pal` abstractions which are also missing here. To support unsupported, create a little macro to handle the fallback case and not introduce ordering between the `cfg`s like `cfg_if!`.

I've named the module `std::sys::env_consts`, because they are used in `std::env::consts` and I intend to use the name `std::sys::env` for the combination of `Args` and `Vars`.

cc `@joboet` `@ChrisDenton`

Tracked in #117276.
2025-04-19 15:09:35 +00:00
..
alloc Apply rustc-0023-Add-Trusty-OS-support-to-Rust-std.patch 2025-03-10 10:00:24 -07:00
anonymous_pipe Mv os-specific trait impl of Pipe* into std::os::* 2025-03-14 01:03:56 +11:00
args Unify owned Args types between platforms 2025-04-12 05:11:27 -07:00
fd Rollup merge of #139667 - 1c3t3a:remove-no-sanitize, r=m-ou-se 2025-04-17 00:16:21 +02:00
fs Rollup merge of #139667 - 1c3t3a:remove-no-sanitize, r=m-ou-se 2025-04-17 00:16:21 +02:00
io Trusty: Implement write_vectored for stdio 2025-03-27 16:49:30 -07:00
net std: Fix build for NuttX targets 2025-04-05 12:05:43 -07:00
os_str Specialize OsString::push for strings 2025-02-28 13:42:31 -08:00
pal Rollup merge of #139868 - thaliaarchi:move-env-consts-pal, r=joboet 2025-04-19 15:09:35 +00:00
path Use with_native_path for Windows 2025-04-11 18:02:03 +00:00
personality Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboet 2025-03-17 05:47:49 -04:00
process Rollup merge of #139667 - 1c3t3a:remove-no-sanitize, r=m-ou-se 2025-04-17 00:16:21 +02:00
random Change the syntax of the internal weak! macro 2025-03-26 16:25:05 +01:00
stdio Rollup merge of #139517 - Ayush1325:uefi-cmd-stdin-null, r=joboet 2025-04-15 15:47:25 +10:00
sync Fix *-win7-windows-msvc target since 26eeac1a1e 2025-02-19 18:05:37 +08:00
thread_local cfi: Remove #[no_sanitize(cfi)] for extern weak functions 2025-04-11 10:15:55 +00:00
backtrace.rs Improve comments for the default backtrace printer 2024-12-04 20:54:37 -05:00
cmath.rs std: make cmath functions safe 2025-03-29 13:08:18 +01:00
env_consts.rs Handle unsupported fallback 2025-04-18 19:49:23 -07:00
exit_guard.rs Attempt to fix CI 2024-07-08 09:19:25 -05:00
mod.rs Combine env consts into std::sys::env_consts 2025-04-18 19:17:08 -07:00