3 Rustdoc has a concept called "passes". These are transformations that
4 `rustdoc` runs on your documentation before producing its final output.
6 In addition to the passes below, check out the docs for these flags:
8 * [`--passes`](command-line-arguments.html#a--passes-add-more-rustdoc-passes)
9 * [`--no-defaults`](command-line-arguments.html#a--no-defaults-dont-run-default-passes)
13 By default, rustdoc will run some passes, namely:
20 However, `strip-private` implies `strip-private-imports`, and so effectively,
21 all passes are run by default.
25 This pass implements the `#[doc(hidden)]` attribute. When this pass runs, it
26 checks each item, and if it is annotated with this attribute, it removes it
27 from `rustdoc`'s output.
29 Without this pass, these items will remain in the output.
31 ## `unindent-comments`
33 When you write a doc comment like this:
36 /// This is a documentation comment.
39 There's a space between the `///` and that `T`. That spacing isn't intended
40 to be a part of the output; it's there for humans, to help separate the doc
41 comment syntax from the text of the comment. This pass is what removes that
44 The exact rules are left under-specified so that we can fix issues that we find.
46 Without this pass, the exact number of spaces is preserved.
50 With this pass, multiple `#[doc]` attributes are converted into one single
56 #[doc = "This is the first line."]
57 #[doc = "This is the second line."]
60 Gets collapsed into a single doc string of
63 This is the first line.
64 This is the second line.
69 This removes documentation for any non-public items, so for example:
72 /// These are private docs.
75 /// These are public docs.
79 This pass removes the docs for `Private`, since they're not public.
81 This pass implies `strip-priv-imports`.
83 ## `strip-priv-imports`
85 This is the same as `strip-private`, but for `extern crate` and `use`
86 statements instead of items.