rust/library/std/src/os
Jubilee 9ccc7b78ec
Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu
Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude

(Note: need to update the PR to add `align_of` and `align_of_val`, and remove the second commit with the myriad changes to appease the lint.)

Many, many projects use `size_of` to get the size of a type. However,
it's also often equally easy to hardcode a size (e.g. `8` instead of
`size_of::<u64>()`). Minimizing friction in the use of `size_of` helps
ensure that people use it and make code more self-documenting.

The name `size_of` is unambiguous: the name alone, without any prefix or
path, is self-explanatory and unmistakeable for any other functionality.
Adding it to the prelude cannot produce any name conflicts, as any local
definition will silently shadow the one from the prelude. Thus, we don't
need to wait for a new edition prelude to add it.
2024-06-05 01:14:29 -07:00
..
aix Support AIX in Rust standard library 2023-10-09 14:02:57 +08:00
android Convert Unix{Datagram,Stream}::{set_}passcred() to per-OS traits 2023-10-25 17:01:21 +09:00
dragonfly Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
emscripten Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
espidf Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
fd put FD validity behind late debug_asserts checking 2024-04-28 01:44:25 +02:00
fortanix_sgx sync the various FromRawFd trait docs, and remove 'valid' 2023-08-14 08:49:40 +02:00
freebsd std::net: adding acceptfilter feature for netbsd/freebsd. 2024-03-20 18:15:31 +00:00
fuchsia Add definitions for riscv64gc-unknown-fuchsia 2023-04-25 16:42:59 -07:00
haiku Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
hermit increase the readability by using the unique name for the hermit-abi 2024-04-23 20:47:02 +02:00
horizon Update libc::stat field names 2022-06-13 20:44:58 -07:00
hurd added support for GNU/Hurd 2023-09-21 17:31:25 +02:00
illumos Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
ios Substitute version placeholders 2023-11-15 19:40:51 -05:00
l4re Remove asmjs from library 2023-10-28 23:10:45 -07:00
linux Finishing clone3 clean up 2024-01-24 17:23:51 +03:00
macos Substitute version placeholders 2023-11-15 19:40:51 -05:00
net os::net: expanding TcpStreamExt for Linux with tcp_deferaccept. 2024-02-21 20:59:15 +00:00
netbsd std::net: adding acceptfilter feature for netbsd/freebsd. 2024-03-20 18:15:31 +00:00
nto Update library/std/src/os/nto/mod.rs 2023-03-01 06:42:40 +01:00
openbsd Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
raw Remove Windows dependency on libc 2024-05-20 11:13:31 -04:00
redox Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
solaris Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
solid kmc-solid: Re-export {As,Borrowed,Owned}Fd in std::os::solid::prelude 2023-11-08 10:52:00 +09:00
uefi Rebase to master 2023-09-22 17:23:33 +05:30
unix Add size_of, size_of_val, align_of, and align_of_val to the prelude 2024-05-13 15:11:28 +02:00
visionos Fixed builds with modified libc 2024-03-23 16:42:06 -07:00
vita PS Vita std support 2023-05-07 18:57:43 +03:00
vxworks Take sys/vxworks/{fd,fs,io} from sys/unix instead. 2020-10-16 06:19:00 +02:00
wasi Factor some common io::Error constants 2024-04-11 09:55:15 +02:00
wasip2 Rename wasm32-wasi-preview2 to wasm32-wasip2 2024-02-27 10:14:45 -05:00
watchos Substitute version placeholders 2023-11-15 19:40:51 -05:00
windows Update documentation related to the recent cmd.exe fix 2024-04-09 23:20:32 -04:00
xous rename ptr::from_exposed_addr -> ptr::with_exposed_provenance 2024-03-23 13:18:33 +01:00
mod.rs Support for visionOS 2024-03-18 20:45:45 -07:00