Skip to content

Commit a01b00f

Browse files
committed
Clarify layout information in Layout::extend
1 parent 5f1fd9d commit a01b00f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libcore/alloc/layout.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,11 @@ impl Layout {
258258

259259
/// Creates a layout describing the record for `self` followed by
260260
/// `next`, including any necessary padding to ensure that `next`
261-
/// will be properly aligned, but *no trailing padding*. In order to
262-
/// match C representation layout, you should call `pad_to_align`
263-
/// after extending the layout with all fields.
261+
/// will be properly aligned, but *no trailing padding*. In order
262+
/// to match C representation layout `repr(C)`, you should call
263+
/// `pad_to_align` after extending the layout with all fields.
264+
/// (There is no way to match the default Rust representation
265+
/// layout `repr(Rust)`, as it is unspecified.)
264266
///
265267
/// Note that the resulting layout will satisfy the alignment properties
266268
/// of both `self` and `next`, in order to ensure alignment of both parts.

0 commit comments

Comments
 (0)