Skip to content

Commit e31191f

Browse files
authored
Merge pull request #2839 from rust-lang/aj/rustc-internals-docs-clarity
Clarifications and instructions for nightly rustc internal docs.
2 parents 1ec60a2 + 6f9e33b commit e31191f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/rustc-driver/external-rustc-drivers.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
The `rustc_private` feature allows external crates to use compiler internals.
88

9-
### Using `rustc-private` with Official Toolchains
9+
### Using `rustc_private` with Official Toolchains
1010

1111
When using the `rustc_private` feature with official Rust toolchains distributed via rustup, you need to install two additional components:
1212

@@ -71,6 +71,20 @@ When developing out-of-tree projects that use `rustc_private` crates, you can co
7171

7272
This configuration allows `rust-analyzer` to properly recognize and provide IDE support for `rustc_private` crates in out-of-tree projects.
7373

74+
### Getting Specific Nightly Documentation for `rustc_private`
75+
76+
The nightly-rustc internal crates' documentation is only available for the latest nightly. If you depend on compiler internals from an older nightly, you may want to refer to the internal documentation from that particular nightly. The only way to do this is to generate the documentation locally. For example, to get documentation for `nightly-2025-11-08`:
77+
78+
Get the Git commit hash for that nightly:
79+
80+
```sh
81+
rustup toolchain install nightly-2025-11-08
82+
rustc +nightly-2025-11-08 --version --verbose
83+
```
84+
85+
The output will include a `commit-hash` line identifying the exact source revision. Check out `rust-lang/rust` at that commit, then follow the steps in [compiler documentation](../building/compiler-documenting.md).
86+
87+
7488
### Additional Resources
7589

7690
- [GitHub Issue #137421] explains that `rustc_private` linker failures often occur because `llvm-tools` is not installed

0 commit comments

Comments
 (0)