From 1565fc21205cf6f589c89732babc6991a7baaee8 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 27 Jun 2018 15:04:49 +0200 Subject: [PATCH] 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. --- src/libcore/alloc.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 0c074582281d6..91447e01ad4fa 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -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`,