Skip to content

Opt-in to rustc_private for rust-analyzer #1736

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

Merged
merged 2 commits into from
Mar 9, 2021

Conversation

DJMcNab
Copy link
Contributor

@DJMcNab DJMcNab commented Mar 8, 2021

@@ -40,3 +40,7 @@ libc = "0.2"
compiletest_rs = { version = "0.5", features = ["tmp"] }
rustc_version = "0.2.3"
colored = "2"

[package.metadata.rust-analyzer]
Copy link
Member

Choose a reason for hiding this comment

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

Is there a documentation of package.metadata.rust-analyzer keys that we could link to here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only documentation is that PR, although some more might be coming soon. CC @jyn514

Copy link
Member

Choose a reason for hiding this comment

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

Would be good to have some link here, a link to the PR would be a start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I missed this comment yesterday

@RalfJung
Copy link
Member

RalfJung commented Mar 8, 2021

Thanks. :)

Does this mean I can remove this from my vscode config?

"rust-analyzer.rustcSource": "/home/r/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc_driver/Cargo.toml"

@DJMcNab
Copy link
Contributor Author

DJMcNab commented Mar 8, 2021

You can't remove that unfortunately - this change simply makes the opt-in per-crate explicit.

I did ask @matklad about that, but at the moment that is not the plan. (The order of operations would make that a more intrusive change at the moment, among other reasons). It might be worth having a rust-analyzer issue to track that question though - see the zulip conversation

This means that having that setting set in your vscode config will no longer adversely effect rust-analyzer performance in crates without rustc_private.

However,

{ "rust-analyzer.rustcSource": "discover" }

might work to fetch that toolchain

@RalfJung
Copy link
Member

RalfJung commented Mar 8, 2021

I saw this "discover" mentioned in your PR but hadn't seen it in the docs before so I was curious about it... I'll have to try that, thanks!

@RalfJung
Copy link
Member

RalfJung commented Mar 9, 2021

Thanks. :) @bors r+

@bors
Copy link
Contributor

bors commented Mar 9, 2021

📌 Commit 6106ee2 has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Mar 9, 2021

⌛ Testing commit 6106ee2 with merge fc41a9c...

@bors
Copy link
Contributor

bors commented Mar 9, 2021

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing fc41a9c to master...

@bors bors merged commit fc41a9c into rust-lang:master Mar 9, 2021
@DJMcNab DJMcNab deleted the rust-analyzer-private branch March 9, 2021 19:00
@RalfJung
Copy link
Member

Yes, "discover" works, very nice. :) This should be advertised much better... (or be the default?)

@DJMcNab
Copy link
Contributor Author

DJMcNab commented Mar 13, 2021

Again, there have been discussions about that, but it's non trivial to plumb through. See also https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Fixed.20crate.20graphs.20and.20optional.20builtin.20crates/near/229387042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants