Skip to content

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

Description

@qouteall

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis issue needs triage to classify its nature and status

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions