Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent compile parts of rustc when using cargo dev ra-setup #5882

Merged
merged 1 commit into from
Aug 9, 2020
Merged

Prevent compile parts of rustc when using cargo dev ra-setup #5882

merged 1 commit into from
Aug 9, 2020

Conversation

dima74
Copy link
Contributor

@dima74 dima74 commented Aug 9, 2020

Currently after running cargo dev ra-setup the following lines are added to Cargo.toml:

[target]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }

This pull request adds dependencies for rustc crates under cfg(NOT_A_PLATFORM), thus preventing them from compiling together with clippy:

[target.'cfg(NOT_A_PLATFORM)'.dependencies]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }

This approach was originally proposed for IntelliJ Rust, and looks like it works for rust-analyzer too.

changelog: none

@rust-highfive
Copy link

r? @Manishearth

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 9, 2020
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 9, 2020

📌 Commit 6af9693 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Aug 9, 2020

⌛ Testing commit 6af9693 with merge 7228368...

@bors
Copy link
Collaborator

bors commented Aug 9, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 7228368 to master...

@bors bors merged commit 7228368 into rust-lang:master Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants