Skip to content

add rust-analyzer to toolchain file and choose working nightly version - #344

Closed
BennoLossin wants to merge 1 commit into
rust-lang:mainfrom
BennoLossin:rust-analyzer
Closed

BennoLossin wants to merge 1 commit into
rust-lang:mainfrom
BennoLossin:rust-analyzer

Conversation

@BennoLossin

Copy link
Copy Markdown
Contributor

fixes the errors rust-analyzer was displaying for judgement functions on my side. Would appreciate some testing from other people especially non-nix users.

@dingxiangfei2009 dingxiangfei2009 left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah, this version worked for me, too.

View changes since this review

@BennoLossin BennoLossin mentioned this pull request Apr 28, 2026
Comment thread rust-toolchain.toml
[toolchain]
channel = "nightly-2025-12-01"
components = ["rustfmt"]
channel = "nightly-2025-11-24"

@nikomatsakis nikomatsakis Apr 28, 2026 •

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.

Wait. Why did you change this back? That date comes from mini-rust so I don't want to change it.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ran a bisect on the r-a version and 2025-11-25 is the earliest that's failing. Some more details on zulip: https://rust-lang.zulipchat.com/#narrow/channel/402470-t-types.2Fformality/topic/rust-analyzer.20errors/near/590543291

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.

Hmm. So basically there's some bug in rust-analyzer we are working around?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This likely stems from rust-lang/rust-analyzer#21097 and some encoding mismatch between the client and server versions. At this point I think we consider this acceptable breakage as the toolchain version you are using is so much older than current rust-analyzer. As for why 2025-12-01 is specifically not working, there were a bunch of bugs after this PR that we slowly fixed, so it might very well be that this nightly range is just overall broken wrt to proc-macros

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the reason for pinning it to the December version is mini-rust (or a dependency)? So also including rust-analyzer in that should be correct, right?

So @nikomatsakis we can maybe "just" merge this and then later increment the pinned version to one that works (since mini-rust or the dependency was incremented by Ralf IIRC)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yea, including rust-analyzer there will make VSCode pick up the corresponding rust-analyzer instead of using the bundled one. (zed iirc does not do that yet)

Ideally you'd do that AND update mini-rust and friends so you can bump the toolchain file to a nightly where r-a isn't as buggy

@rustbot

rustbot commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@BennoLossin

Copy link
Copy Markdown
Contributor Author

I haven't followed the repo updates, do we still need this PR?

@BennoLossin

Copy link
Copy Markdown
Contributor Author

I just checked this again, I still get errors without this patch, so I'll leave this open. I think regardless of which rust version we end up pinning, rust-analyzer should also be pinned, since then it won't stop working in the future.

If we don't end up pinning the Rust version, then I think we can close this.

@Veykril

Veykril commented Jun 2, 2026 •

Copy link
Copy Markdown
Member

I think regardless of which rust version we end up pinning, rust-analyzer should also be pinned, since then it won't stop working in the future.

^ generally if you pin your toolchain you want to add the rust-analyzer component to the toolchain file

#369 fixes the r-a errors for you fwiw, the current pinned toolchain just has a buggy r-a

@nikomatsakis

Copy link
Copy Markdown
Contributor

Closing in favor of #369

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.

5 participants