diff options
| author | Christopher Durham <cad97@cad97.com> | 2020-04-16 16:44:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 16:44:30 -0400 |
| commit | 5f1fd9da5488cc2fe88dc89e5ca3f183526388a9 (patch) | |
| tree | 88b02c5f9d9abad7d4f5e1fe9066b30f31e2a5c5 /src/libcore/alloc | |
| parent | 053c2dddda209444e7dd0bc8df2f4b0f8337e9f5 (diff) | |
| download | rust-5f1fd9da5488cc2fe88dc89e5ca3f183526388a9.tar.gz rust-5f1fd9da5488cc2fe88dc89e5ca3f183526388a9.zip | |
Apply suggestions from code review
Co-Authored-By: Ralf Jung <post@ralfj.de>
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 |
