Skip to content

Commit 25b8102

Browse files
authored
Guarantee that Layout::align returns a non-zero power of two
1 parent 70c7e4d commit 25b8102

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 non-zero 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)