summaryrefslogtreecommitdiffstats
path: root/src/doc/rustc-dev-guide/src/building/compiler-documenting.md
blob: 965e004c983b9870822e1d9f09c9b70a9c0d6a15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Building documentation

This chapter describes how to build documentation of toolchain components,
like the standard library (std) or the compiler (rustc).

- Document everything

  This uses `rustdoc` from the beta toolchain,
  so will produce (slightly) different output to stage 1 rustdoc,
  as rustdoc is under active development:

  ```bash
  ./x.py doc
  ```

  If you want to be sure the documentation looks the same as on CI:

  ```bash
  ./x.py doc --stage 1
  ```

  This ensures that (current) rustdoc gets built,
  then that is used to document the components.

- Much like running individual tests or building specific components,
  you can build just the documentation you want:

  ```bash
  ./x.py doc src/doc/book
  ./x.py doc src/doc/nomicon
  ./x.py doc compiler library
  ```

- Document internal rustc items

  Compiler documentation is not built by default.
  To create it by default with `x.py doc`, modify `config.toml`:

  ```toml
  [build]
  compiler-docs = true
  ```

  Note that when enabled,
  documentation for internal compiler items will also be built.

  NOTE: The documentation for the compiler is found at [this link].

[this link]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/