Rollup merge of #115653 - joshlf:patch-9, r=dtolnay

Guarantee that Layout::align returns a non-zero power of two
This commit is contained in:
Matthias Krüger 2023-10-14 13:48:18 +02:00 committed by GitHub
commit 3899957086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,6 +130,8 @@ pub const fn size(&self) -> usize {
}
/// 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, \