Skip to content

Commit 71a4add

Browse files
committed
Document --show-type-layout in the rustdoc book
1 parent ac2d9fc commit 71a4add

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

+16
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,22 @@ some consideration for their stability, and names that end in a number). Giving
209209
`rustdoc` will disable this sorting and instead make it print the items in the order they appear in
210210
the source.
211211

212+
### `--show-type-layout`: add a section to each type's docs describing its memory layout
213+
214+
Using this flag looks like this:
215+
216+
```bash
217+
$ rustdoc src/lib.rs -Z unstable-options --show-type-layout
218+
```
219+
220+
When this flag is passed, rustdoc will add a "Layout" section at the bottom of
221+
each type's docs page that includes a summary of the type's memory layout as
222+
computed by rustc. For example, rustdoc will show the size in bytes that a value
223+
of that type will take in memory.
224+
225+
Note that most layout information is **completely unstable** and may even differ
226+
between compilations.
227+
212228
### `--resource-suffix`: modifying the name of CSS/JavaScript in crate docs
213229

214230
Using this flag looks like this:

0 commit comments

Comments
 (0)