Add a comment about how Layout::extend matches the C struct layout

This commit is contained in:
Amanieu d'Antras 2018-10-27 22:38:37 +01:00
parent 05812fa8c5
commit 94f3ce9def

View File

@ -248,6 +248,9 @@ impl Layout {
/// 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