Skip to content

Commit cc4f97e

Browse files
talk about --sort-modules-by-appearance
1 parent 33ed787 commit cc4f97e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,16 @@ $ rustdoc --test README.md -Z unstable-options --linker foo
279279
When `rustdoc` runs your documentation tests, it needs to compile and link the tests as executables
280280
before running them. This flag can be used to change the linker used on these executables. It's
281281
equivalent to passing `-C linker=foo` to `rustc`.
282+
283+
### `--sort-modules-by-appearance`: control how items on module pages are sorted
284+
285+
Using this flag looks like this:
286+
287+
```bash
288+
$ rustdoc src/lib.rs -Z unstable-options --sort-modules-by-appearance
289+
```
290+
291+
Ordinarily, when `rustdoc` prints items in module pages, it will sort them alphabetically (taking
292+
some consideration for their stability, and names that end in a number). Giving this flag to
293+
`rustdoc` will disable this sorting and instead make it print the items in the order they appear in
294+
the source.

0 commit comments

Comments
 (0)