diff options
Diffstat (limited to 'src/libcore/alloc')
| -rw-r--r-- | src/libcore/alloc/layout.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/alloc/layout.rs b/src/libcore/alloc/layout.rs index 2ad36627403..be62671f59f 100644 --- a/src/libcore/alloc/layout.rs +++ b/src/libcore/alloc/layout.rs @@ -274,7 +274,8 @@ impl Layout { /// /// # Examples /// - /// To calculate the layout of a `#[repr(C)]` structure from its fields' layouts: + /// To calculate the layout of a `#[repr(C)]` structure and the offsets of + /// the fields from its fields' layouts: /// /// ```rust /// # use std::alloc::{Layout, LayoutErr}; @@ -286,6 +287,7 @@ impl Layout { /// layout = new_layout; /// offsets.push(offset); /// } + /// // Remember to finalize with `pad_to_align`! /// Ok((layout.pad_to_align(), offsets)) /// } /// # // test that it works |
