Skip to content

Commit 838b948

Browse files
authored
Rollup merge of rust-lang#115653 - joshlf:patch-9, r=dtolnay
Guarantee that Layout::align returns a non-zero power of two
2 parents 139f63a + a9b0966 commit 838b948

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/alloc/layout.rs

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ impl Layout {
130130
}
131131

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

0 commit comments

Comments
 (0)