rust/library/std/src
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
..
backtrace remove redundant imports 2023-12-10 10:56:22 +08:00
collections Fix typo in the docs of HashMap::raw_entry_mut 2024-06-03 17:35:58 +01:00
env remove redundant imports 2023-12-10 10:56:22 +08:00
error core/any: remove Provider trait 2023-08-13 13:07:53 -06:00
f16 Add basic f16 and f128 modules 2024-04-10 13:50:27 -04:00
f32 Add gamma and ln_gamma functions to f32 and f64 2023-07-31 07:41:50 -07:00
f64 Add gamma and ln_gamma functions to f32 and f64 2023-07-31 07:41:50 -07:00
f128 Add basic f16 and f128 modules 2024-04-10 13:50:27 -04:00
ffi PathBuf: replace transmuting by accessor functions 2024-04-26 18:09:09 +02:00
fs Make more of the test suite run on Mac Catalyst 2024-05-28 12:31:33 +02:00
hash update version placeholders 2023-12-22 11:01:42 +01:00
io Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu 2024-06-05 01:14:29 -07:00
net SeqCst->Relaxed in std::net::test. 2024-03-20 15:35:13 +01:00
num removed nonfunctioning benchmark 2024-01-11 11:30:12 -05:00
os Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu 2024-06-05 01:14:29 -07:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Panic if PathBuf::set_extension would add a path separator 2024-05-13 15:08:34 +02:00
prelude Add size_of, size_of_val, align_of, and align_of_val to the prelude 2024-05-13 15:11:28 +02:00
process Rollup merge of #114379 - RalfJung:command-removed-env-vars, r=m-ou-se 2023-09-22 12:15:25 +02:00
sync Rollup merge of #125696 - workingjubilee:please-dont-say-you-are-lazy, r=Nilstrieb 2024-06-04 21:41:34 +02:00
sys Rollup merge of #125919 - tbu-:pr_fix_typo, r=lqd 2024-06-04 08:25:49 +01:00
sys_common std: move thread parking to sys::sync 2024-05-02 12:38:26 +02:00
thread std: make TLS accessors closures that return pointers 2024-05-25 00:19:47 +02:00
time Rollup merge of #103056 - beetrees:timespec-bug-fix, r=thomcc 2023-05-05 18:40:32 +05:30
alloc.rs default_alloc_error_hook: explain difference to default __rdl_oom in alloc 2024-05-03 19:12:33 +02:00
ascii.rs Add the basic ascii::Char type 2023-05-03 22:09:33 -07:00
backtrace.rs rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
env.rs Elaborate about modifying env vars in multi-threaded programs 2024-05-29 23:42:27 +02:00
error.rs Clean dead codes 2023-11-26 09:25:07 +08:00
f16.rs Add powi to f16 and f128 2024-05-16 15:41:06 -05:00
f32.rs variable-precision float operations behave non-deterministically 2024-05-02 18:57:30 +02:00
f64.rs variable-precision float operations behave non-deterministically 2024-05-02 18:57:30 +02:00
f128.rs Add powi to f16 and f128 2024-05-16 15:41:06 -05:00
fs.rs Document platform-specifics for Read and Write of File 2024-05-20 21:21:53 +02:00
keyword_docs.rs Mention labelled blocks in break docs 2024-03-15 10:51:57 -07: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 Replace fake "restricted-std" Cargo feature by custom cfg 2024-05-23 15:54:02 +02:00
macros.rs added column number to dbg!() 2023-12-12 18:12:23 +08:00
num.rs Replace version placeholders for 1.79 2024-05-01 21:01:51 -04:00
panic.rs catch_panic: warn about panicking payload drop 2024-03-31 11:54:16 +02:00
panicking.rs when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation 2024-04-18 12:05:08 +02:00
pat.rs Add pattern types to parser 2024-04-08 11:57:17 +00:00
path.rs Auto merge of #125070 - tbu-:pr_set_extension_panic, r=jhpratt 2024-05-26 04:14:32 +00:00
process.rs Rollup merge of #123709 - tgross35:windows-cmd-docs-update, r=ChrisDenton 2024-05-19 11:04:07 -04:00
rt.rs Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
time.rs Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00