Skip to content

Commit 94f3ce9

Browse files
committed
Add a comment about how Layout::extend matches the C struct layout
1 parent 05812fa commit 94f3ce9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libcore/alloc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ impl Layout {
248248
/// will be properly aligned. Note that the result layout will
249249
/// satisfy the alignment properties of both `self` and `next`.
250250
///
251+
/// The resulting layout will be the same as that of a C struct containing
252+
/// two fields with the layouts of `self` and `next`, in that order.
253+
///
251254
/// Returns `Some((k, offset))`, where `k` is layout of the concatenated
252255
/// record and `offset` is the relative location, in bytes, of the
253256
/// start of the `next` embedded within the concatenated record

0 commit comments

Comments
 (0)