Closed Avrimuskom closed 5 months ago
can't load standard library from sysroot
C:\Program Files\Rust stable MSVC 1.77
(discovered via rustc --print sysroot
)
try installing the Rust source the same way you installed rustc
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"
That sounds like your rust installation is a bit weird, given we should auto discover the sysroot just fine usually
first I installed via RUSTUP-INIT.EXE (64-BIT) then https://static.rust-lang.org/dist/rust-1.77.2-x86_64-pc-windows-msvc.msi
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"
It works for me. Thanks so much!!!
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"
Thanks!
Same error on Ubuntu 22.04.4 LTS, fixed by installing rust-src package:
sudo apt install rust-src
Same on arch linux. Fixed with pacman -S rust-src
Same on arch linux. Fixed with
pacman -S rust-src
It works for me, Arch WSL2, thanks!
rustup component add rust-src
worked for me.
I installed rust with curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
.
I don't know why that happened.
rustc --print sysroot
from: D:\EnvDev\rust-src\lib\rustlib
to: D:\EnvDev\Rust\lib\rustlib
Windows 10 x64 Rust 1.77.2 MS VS Code 1.88.1 After install rust analyzer view error