Skip to content

Commit

Permalink
Rollup merge of #51842 - rust-lang:align-is-nonzero, r=cramertj
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kennytm authored Jun 27, 2018
2 parents 7f4347f + 1565fc2 commit 99a0d6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ impl Layout {
/// or returns `LayoutErr` if either of the following conditions
/// are not met:
///
/// * `align` must not be zero,
///
/// * `align` must be a power of two,
///
/// * `size`, when rounded up to the nearest multiple of `align`,
Expand Down

0 comments on commit 99a0d6b

Please sign in to comment.