Skip to content

Commit 5f1fd9d

Browse files
CAD97RalfJung
andauthored
Apply suggestions from code review
Co-Authored-By: Ralf Jung <[email protected]>
1 parent 053c2dd commit 5f1fd9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libcore/alloc/layout.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ impl Layout {
274274
///
275275
/// # Examples
276276
///
277-
/// To calculate the layout of a `#[repr(C)]` structure from its fields' layouts:
277+
/// To calculate the layout of a `#[repr(C)]` structure and the offsets of
278+
/// the fields from its fields' layouts:
278279
///
279280
/// ```rust
280281
/// # use std::alloc::{Layout, LayoutErr};
@@ -286,6 +287,7 @@ impl Layout {
286287
/// layout = new_layout;
287288
/// offsets.push(offset);
288289
/// }
290+
/// // Remember to finalize with `pad_to_align`!
289291
/// Ok((layout.pad_to_align(), offsets))
290292
/// }
291293
/// # // test that it works

0 commit comments

Comments
 (0)