about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2021-09-21 19:12:10 -0700
committerNoah Lev <camelidcamel@gmail.com>2021-09-21 19:12:10 -0700
commit71a4add26e39d9d1f45ab987741a99e465bb0f5e (patch)
tree2c63afba4ed6ed11d9e658826ef8c91ac638703e
parentac2d9fc509e36d1b32513744adf58c34bcc4f43c (diff)
downloadrust-71a4add26e39d9d1f45ab987741a99e465bb0f5e.tar.gz
rust-71a4add26e39d9d1f45ab987741a99e465bb0f5e.zip
Document `--show-type-layout` in the rustdoc book
-rw-r--r--src/doc/rustdoc/src/unstable-features.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md
index b55db452f12..d669230b8bf 100644
--- a/src/doc/rustdoc/src/unstable-features.md
+++ b/src/doc/rustdoc/src/unstable-features.md
@@ -209,6 +209,22 @@ some consideration for their stability, and names that end in a number). Giving
 `rustdoc` will disable this sorting and instead make it print the items in the order they appear in
 the source.
 
+### `--show-type-layout`: add a section to each type's docs describing its memory layout
+
+Using this flag looks like this:
+
+```bash
+$ rustdoc src/lib.rs -Z unstable-options --show-type-layout
+```
+
+When this flag is passed, rustdoc will add a "Layout" section at the bottom of
+each type's docs page that includes a summary of the type's memory layout as
+computed by rustc. For example, rustdoc will show the size in bytes that a value
+of that type will take in memory.
+
+Note that most layout information is **completely unstable** and may even differ
+between compilations.
+
 ### `--resource-suffix`: modifying the name of CSS/JavaScript in crate docs
 
 Using this flag looks like this: