Skip to content

chore(toolchain): add rust-analyzer to nightly components - #419

Merged
agicy merged 1 commit into
syswonder:devfrom
li041:toolchain
Nov 9, 2026
Merged

agicy merged 1 commit into
syswonder:devfrom
li041:toolchain

Conversation

@li041

@li041 li041 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds rust-analyzer to the pinned nightly toolchain components in rust-toolchain.toml:

-components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"]
+components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy", "rust-analyzer"]

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

  • rustup show active-toolchain parses the updated file and resolves to nightly-2024-05-05-x86_64-unknown-linux-gnu (overridden by rust-toolchain.toml) — the toolchain file is well-formed and the pin is unchanged.

Risks and Limitations

  • The rust-analyzer version becomes effectively pinned to the 2024-05-05 nightly, which is older than standalone rust-analyzer releases. This is a deliberate trade-off to keep the language server aligned with the compiler it must understand; developers using a separate newer rust-analyzer are unaffected and keep working as before.

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.
@li041
li041 requested a review from agicy November 9, 2026 06:52

@agicy agicy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@agicy
agicy merged commit 0c805a0 into syswonder:dev Nov 9, 2026
7 of 9 checks passed
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.

2 participants