Skip to content

Commit 99a0d6b

Browse files
authored
Rollup merge of #51842 - rust-lang:align-is-nonzero, r=cramertj
Document that Layout::from_size_align does not allow align=0 This was already implied since zero is not a power of two, but maybe worth pointing out.
2 parents 7f4347f + 1565fc2 commit 99a0d6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcore/alloc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ impl Layout {
6767
/// or returns `LayoutErr` if either of the following conditions
6868
/// are not met:
6969
///
70+
/// * `align` must not be zero,
71+
///
7072
/// * `align` must be a power of two,
7173
///
7274
/// * `size`, when rounded up to the nearest multiple of `align`,

0 commit comments

Comments
 (0)