Skip to content

Commit

Permalink
Rollup merge of rust-lang#115653 - joshlf:patch-9, r=dtolnay
Browse files Browse the repository at this point in the history
Guarantee that Layout::align returns a non-zero power of two
  • Loading branch information
matthiaskrgr authored Oct 13, 2023
2 parents 34bc571 + a9b0966 commit 0da6895
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ impl Layout {
}

/// The minimum byte alignment for a memory block of this layout.
///
/// The returned alignment is guaranteed to be a power of two.
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[rustc_const_stable(feature = "const_alloc_layout_size_align", since = "1.50.0")]
#[must_use = "this returns the minimum alignment, \
Expand Down

0 comments on commit 0da6895

Please sign in to comment.