Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/rustc-driver/external-rustc-drivers.md
Copy link
Copy Markdown
Member

@tshepang tshepang Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there is a rustup component that includes compiler api docs, rustc-docs

❯ rustup component add rustc-docs
info: downloading component rustc-docs
   rustc-docs installed                       32.34 MiB
❯ rustup doc --rustc-docs
Opening docs named `rustc-docs` in your browser

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience this did not add the internal rustc docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the component was added several weeks ago, and yeah, it does not exist for your example nightly

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

### Using `rustc-private` with Official Toolchains
### Using `rustc_private` with Official Toolchains

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

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

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

### Getting Specific Nightly Documentation for `rustc_private`

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`:
Copy link
Copy Markdown
Member

@tshepang tshepang Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • this does not make it clear what nightly-rustc means... I assume that it means from the website
  • it should at least mention that the docs are available via rustup

View changes since the review


Get the Git commit hash for that nightly:

```sh
rustup toolchain install nightly-2025-11-08
rustc +nightly-2025-11-08 --version --verbose
```

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).


### Additional Resources

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