rust-lang / rust-lang/rustc-dev-guide

[Suggestion] Add how to use RustRover for Rust compiler development

Open Beginner friendly
#2,858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
HTML
Stars
1.9k
Forks
613
Avg merge
17h 24m
Merged PRs (30d)
39

Description

Here is a (hacky) way to get RustRover to work in Rust compiler repo:

Create .cargo folder, create config.toml folder, content:

[env]
RUSTC_BOOTSTRAP = "1"
CFG_RELEASE="1.95.0"
CFG_RELEASE_CHANNEL="dev"
CFG_VERSION="1.95.0-dev"

Replace the 1.95.0 with the content in src/version file.

(To avoid commiting that file to git, add .cargo/config.toml into .git/info/exclude)

In compiler/rustc/Cargo.toml, find the check_only, click the checkbox in gutter:

Image

(if the checkbox doesn't show, wait for a little time)

Also enable the check_only feature in src/tools/miri/genmc-sys/Cargo.toml using the same way.

Then the most IDE functionality will work in Rust compiler repo. (But Rust compiler uses some unstable features that RustRover doesn't yet support well. One example is trait alias. Many codegen code uses trait alias CodegenMethods which RustRover doesn't work for.)

Don't attach std lib crate in RustRover. After attaching, it will show wrong code errors like "Trait PointeeSized is not implemented for str". To unattach, open cargo tool window, select crate, click minus sign.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the rustc-dev-guide section for compiler development tooling, then verify the version source in src/version and the check_only settings in compiler/rustc/Cargo.toml and src/tools/miri/genmc-sys/Cargo.toml. Document the RustRover setup, .cargo/config.toml exclusion, and standard-library caveat; done when contributors can follow the workflow without relying on the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.