rust/library
Matthias Krüger 94b9ea417d
Rollup merge of #126213 - zachs18:atomicbool-u8-i8-from-ptr-alignment, r=Nilstrieb
Update docs for AtomicBool/U8/I8 with regard to alignment

Fixes #126084.

Since `AtomicBool`/`AtomicU8`/`AtomicI8` are guaranteed to have size == 1, and Rust guarantees that `size % align == 0`, they also must have alignment equal to 1, so some current docs are contradictory/confusing when describing their alignment requirements.

Specifically:

* Fix `AtomicBool::from_ptr` claiming that `align_of::<AtomicBool>() > align_of::<bool>()` on some platforms. (same for `AtomicU8::from_ptr`/`AtomicI8::from_ptr`)
* Explicitly state that `AtomicU8`/`AtomicI8` have the same alignment as `u8`/`i8` (in addition to size and bit validity)
* (internal) Change the `if_not_8_bit` macro to be `if_8_bit` and to allow an "if-else"-like structure, instead of just "if"-like.

---

I opted to leave the "`ptr` must be aligned" wording in `from_ptr`'s docs and just clarify that it is always satsified, instead of just removing the wording entirely. If that is instead preferred I can do that.
2024-06-24 15:06:21 +02:00
..
alloc Auto merge of #126838 - matthiaskrgr:rollup-qkop22o, r=matthiaskrgr 2024-06-22 18:48:10 +00:00
backtrace@72265bea21 Update backtrace to 0.3.73 2024-06-06 22:50:45 -07:00
core Rollup merge of #126213 - zachs18:atomicbool-u8-i8-from-ptr-alignment, r=Nilstrieb 2024-06-24 15:06:21 +02:00
panic_abort Stabilise c_unwind 2024-06-19 13:54:51 +01:00
panic_unwind Auto merge of #125853 - tesuji:promote-fail-fast, r=cjgillot 2024-06-21 16:00:14 +00:00
portable-simd Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
proc_macro Add a hack to prevent proc_macro misopt in CI 2024-06-19 13:54:55 +01:00
profiler_builtins Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #126854 - devnexen:std_unix_os_fallback_upd, r=Mark-Simulacrum 2024-06-24 06:27:16 +02:00
stdarch@df3618d9f3 feat: update stdarch submodule for intrinsics on ARM 2024-05-15 15:38:58 -04:00
sysroot Add flag to sysroot 2024-05-11 14:31:55 +02:00
test Add blank lines after module-level //! comments. 2024-06-20 09:23:20 +10:00
unwind Stabilise c_unwind 2024-06-19 13:54:51 +01:00