]> git.lizzy.rs Git - rust.git/commitdiff
Document that Layout::from_size_align does not allow align=0
authorSimon Sapin <simon.sapin@exyr.org>
Wed, 27 Jun 2018 13:04:49 +0000 (15:04 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Wed, 27 Jun 2018 13:07:42 +0000 (15:07 +0200)
This was already implied since zero is not a power of two, but maybe
worth pointing out.

src/libcore/alloc.rs

index 0c074582281d6414617a30050bd82d5a20290160..91447e01ad4fabb6932022f22a8bd7f01f83c46f 100644 (file)
@@ -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`,