]> git.lizzy.rs Git - rust.git/commitdiff
Add a comment about how Layout::extend matches the C struct layout
authorAmanieu d'Antras <amanieu@gmail.com>
Sat, 27 Oct 2018 21:38:37 +0000 (22:38 +0100)
committerAmanieu d'Antras <amanieu@gmail.com>
Tue, 6 Nov 2018 17:21:13 +0000 (17:21 +0000)
src/libcore/alloc.rs

index 4efcaae59b012ce1a192c4a51379d8d9a0c20c53..bc2860a5a2f74fadd0e732760e9c0624eba34630 100644 (file)
@@ -248,6 +248,9 @@ pub fn repeat(&self, n: usize) -> Result<(Self, usize), LayoutErr> {
     /// will be properly aligned. Note that the result layout will
     /// satisfy the alignment properties of both `self` and `next`.
     ///
+    /// The resulting layout will be the same as that of a C struct containing
+    /// two fields with the layouts of `self` and `next`, in that order.
+    ///
     /// Returns `Some((k, offset))`, where `k` is layout of the concatenated
     /// record and `offset` is the relative location, in bytes, of the
     /// start of the `next` embedded within the concatenated record