Repository navigation
chore(toolchain): add rust-analyzer to nightly components - #419
Merged
Merged
Conversation
Include rust-analyzer in the pinned nightly toolchain so that IDE language-server features work out of the box with rustup, without requiring a separately installed toolchain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
rust-analyzerto the pinned nightly toolchain components inrust-toolchain.toml:Motivation
The repo pins channel = "nightly-2024-05-05" with profile = "minimal", so rustup installs only what is explicitly listed under components. The intended workflow still relies on rust-analyzer — the commit that introduced the current pinned toolchain (d16d9f7) was made specifically "to use latest rust-analyzer" — but the component itself was never listed.
As a result, when contributors open the project, their IDE language server runs a rust-analyzer from a different toolchain (typically their default stable one), built against a compiler version that differs from the nightly-2024-05-05 that hvisor is actually compiled with. This causes stale completions, warnings against a mismatched compiler version, and broken or empty go-to-definition, since proc-macros and the #![no_std] core setup only resolve correctly on the pinned nightly.
Listing rust-analyzer in the file makes rustup install it automatically, matching the pinned toolchain, so IDE setup works out of the box.
Verification
Risks and Limitations