rust/library
Jacob Pratt 43ad753adb
Rollup merge of #122729 - m-ou-se:relax, r=Amanieu
Relax SeqCst ordering in standard library.

Every single SeqCst in the standard library is unnecessary. In all cases, Relaxed or Release+Acquire was sufficient.

As I [wrote](https://marabos.nl/atomics/memory-ordering.html#common-misconceptions) in my book on atomics:

> [..] when reading code, SeqCst basically tells the reader: "this operation depends on the total order of every single SeqCst operation in the program," which is an incredibly far-reaching claim. The same code would likely be easier to review and verify if it used weaker memory ordering instead, if possible. For example, Release effectively tells the reader: "this relates to an acquire operation on the same variable," which involves far fewer considerations when forming an understanding of the code.
>
> It is advisable to see SeqCst as a warning sign. Seeing it in the wild often means that either something complicated is going on, or simply that the author did not take the time to analyze their memory ordering related assumptions, both of which are reasons for extra scrutiny.

r? ````@Amanieu```` ````@joboet````
2024-03-20 20:29:44 -04:00
..
alloc Rollup merge of #122729 - m-ou-se:relax, r=Amanieu 2024-03-20 20:29:44 -04:00
backtrace@6fa4b85b99 Use rust-lang/backtrace-rs@6fa4b85 2024-03-14 12:37:43 -07:00
core Rollup merge of #122729 - m-ou-se:relax, r=Amanieu 2024-03-20 20:29:44 -04:00
panic_abort Cleanup windows abort_internal 2024-03-02 18:22:15 +00:00
panic_unwind SeqCst->Relaxed in panic_unwind/emcc. 2024-03-19 15:27:11 +01:00
portable-simd Merge commit '649110751ef4f27440d7cc711b3e07d11bf02d4a' into sync-portable-simd-2024-02-18 2024-02-18 10:14:03 -05:00
proc_macro SeqCst->Relaxed for proc_macro bridge counter. 2024-03-19 15:27:11 +01:00
profiler_builtins Update version of cc crate 2024-03-14 16:42:15 +00:00
rtstartup library: Fix warnings in rtstartup 2024-01-06 01:32:03 +03:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #122729 - m-ou-se:relax, r=Amanieu 2024-03-20 20:29:44 -04:00
stdarch@56087ea170 Rename wasm32-wasi-preview2 to wasm32-wasip2 2024-02-27 10:14:45 -05:00
sysroot Expose compiler-builtins-weak-intrinsics feature for -Zbuild-std 2023-06-23 11:15:34 +01:00
test libtest: Print timing information on WASI 2024-03-11 09:36:35 -07:00
unwind step cfgs 2024-03-20 08:49:13 -04:00