Skip to content

Commit

Permalink
Unrolled build for rust-lang#120823
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#120823 - LegionMammal978:clarify-atomic-align, r=RalfJung

Clarify that atomic and regular integers can differ in alignment

The documentation for atomic integers says that they have the "same in-memory representation" as their underlying integers. This might be misconstrued as implying that they have the same layout. Therefore, clarify that atomic integers' alignment is equal to their size.
  • Loading branch information
rust-timer authored Feb 10, 2024
2 parents 232919c + c94bbb2 commit de3bd15
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2119,7 +2119,16 @@ macro_rules! atomic_int {
/// This type has the same in-memory representation as the underlying
/// integer type, [`
#[doc = $s_int_type]
/// `]. For more about the differences between atomic types and
/// `].
#[doc = if_not_8_bit! {
$int_type,
concat!(
"However, the alignment of this type is always equal to its ",
"size, even on targets where [`", $s_int_type, "`] has a ",
"lesser alignment."
)
}]
/// For more about the differences between atomic types and
/// non-atomic types as well as information about the portability of
/// this type, please see the [module-level documentation].
///
Expand Down

0 comments on commit de3bd15

Please sign in to comment.