rust-analyzer: can't load standard library from sysroot
Windows 10 x64
Rust 1.77.2
MS VS Code 1.88.1
After install rust analyzer view error
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (1 by maintainers)
Same on arch linux. Fixed with
pacman -S rust-srcSame error on Ubuntu 22.04.4 LTS, fixed by installing rust-src package:
Solved: Need open file setting.json in dir C:\Users%User%AppData\Roaming\Code\User\settings.json My example C:\Users\AveN\AppData\Roaming\Code\User\settings.json and change “rust-analyzer.cargo.sysroot”: null on “rust-analyzer.cargo.sysroot”: “C:/Users/%User%/.rustup/toolchains/stable-x86_64-pc-windows-msvc” on my example “rust-analyzer.cargo.sysroot”: “C:/Users/AveN/.rustup/toolchains/stable-x86_64-pc-windows-msvc”
Hi, The new version 0.3.2308 introduce regression in regard of find std sources: I use nix to provide rust environment, and it worked before this version. Here is my nix configuration:
default.nix
build.nix
shell.nix
It works for me. Thanks so much!!!
rustup component add rust-srcworked for me.
I installed rust with
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. I don’t know why that happened.