rust/library/core
Matthias Krüger a9ed9fb943
Rollup merge of #121943 - joshlf:patch-11, r=scottmcm
Clarify atomic bit validity

The previous definition used the phrase "representation", which is ambiguous given the current state of memory model nomenclature in Rust. For integer types and for `AtomicPtr<T>`, the new wording clarifies that size and bit validity are guaranteed to match the corresponding native integer type/`*mut T`. For `AtomicBool`, the new wording clarifies that size, alignment, and bit validity are guaranteed to match `bool`.

Note that we use the phrase "size and alignment" rather than "layout" since the latter term also implies that the field types are the same. This isn't true - `AtomicXxx` doesn't store an `xxx`, but rather an `UnsafeCell<xxx>`. This distinction is important for some `unsafe` code, which needs to reason about the presence or absence of interior mutability in order to ensure that their code is sound (see e.g. https://github.com/google/zerocopy/issues/251).
2024-03-27 23:27:22 +01:00
..
benches Add benches for net parsing 2024-03-04 18:46:24 -05:00
src Rollup merge of #121943 - joshlf:patch-11, r=scottmcm 2024-03-27 23:27:22 +01:00
tests step cfgs 2024-03-20 08:49:13 -04:00
Cargo.toml Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00