diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-27 23:27:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-27 23:27:22 +0100 |
| commit | a9ed9fb943883d400fc612ccf26b4ce5edb9e11e (patch) | |
| tree | 73d7ba3f78e2850e6d2429c34560e4fa693270bc /compiler/rustc_pattern_analysis/src | |
| parent | c9f8f3438a8134a413aa5d4903e0196e44e37bbc (diff) | |
| parent | a6e3e02d70708c6777e2b4090e12d7ee528fd1ac (diff) | |
| download | rust-a9ed9fb943883d400fc612ccf26b4ce5edb9e11e.tar.gz rust-a9ed9fb943883d400fc612ccf26b4ce5edb9e11e.zip | |
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).
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions
