This repository was archived by the owner on Mar 8, 2025. It is now read-only.
I think this solves the rust-analyzer problem #20
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.
Hey, I saw your post on mastodon and decided to investigate.
I got here from error message -> search for "rust standard library environment variable" -> find rust-lang/rust-analyzer#4172 -> search for "RUST_SRC_PATH" nixOS -> https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/5
which just requires plopping
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
in flake.nix, at least on my machine (nixOS, though, so I haven't tested other OSes)I don't know much of the rust ecosystem on nix, and I'm fairly new to nix (via nixOS), but this seems to fix the rust analyzer issues for me.
I'm having other rust problems because nixOS, but if you could test this and see if it works it might be an easy fix -- it got rid of the error you were talking about.