Repository navigation
Closed
Description
I see
rust-analyzer failed to load workspace: Failed to find sysroot for Cargo.toml file [...]/Cargo.toml. Is rust-src installed?: can't load standard library from sysroot /home/at/.rustup/toolchains/nightly-2020-07-29-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src (discovered via `rustc --print sysroot`) try running `rustup component add rust-src` or set `RUST_SRC_PATH`
with the rust-src component installed on nightly-2020-07-29.
rust-analyzer expects let src_path = sysroot_path.join("lib/rustlib/src/rust/src"); but nightly-2020-07-29 seems to have changed the paths:
/home/at/.rustup/toolchains/nightly-2020-07-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/:
total 118,784
-rw-r----- 1 at at 115,526 2020-07-29 21:25 Cargo.lock
drwxr-x--- 1 at at 260 2020-07-29 21:25 src/
/home/at/.rustup/toolchains/nightly-2020-07-29-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/:
total 118,784
-rw-r----- 1 at at 115,526 2020-07-29 21:17 Cargo.lock
drwxr-x--- 1 at at 328 2020-07-29 21:17 library/
# ls -l /home/at/.rustup/toolchains/nightly-2020-07-28-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
total 0
drwxr-x--- 1 at at 32 2020-07-29 21:25 build_helper/
drwxr-x--- 1 at at 340 2020-07-29 21:25 liballoc/
drwxr-x--- 1 at at 638 2020-07-29 21:25 libcore/
drwxr-x--- 1 at at 32 2020-07-29 21:25 libpanic_abort/
drwxr-x--- 1 at at 128 2020-07-29 21:25 libpanic_unwind/
drwxr-x--- 1 at at 96 2020-07-29 21:25 libproc_macro/
drwxr-x--- 1 at at 48 2020-07-29 21:25 libprofiler_builtins/
drwxr-x--- 1 at at 534 2020-07-29 21:25 libstd/
drwxr-x--- 1 at at 60 2020-07-29 21:25 libterm/
drwxr-x--- 1 at at 250 2020-07-29 21:25 libtest/
drwxr-x--- 1 at at 72 2020-07-29 21:25 libunwind/
drwxr-x--- 1 at at 234 2020-07-29 21:25 stdarch/
drwxr-x--- 1 at at 144 2020-07-29 21:25 tools/
# ls -l /home/at/.rustup/toolchains/nightly-2020-07-29-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library
total 0
drwxr-x--- 1 at at 50 2020-07-29 21:17 alloc/
drwxr-x--- 1 at at 50 2020-07-29 21:17 core/
drwxr-x--- 1 at at 26 2020-07-29 21:17 panic_abort/
drwxr-x--- 1 at at 26 2020-07-29 21:17 panic_unwind/
drwxr-x--- 1 at at 36 2020-07-29 21:17 proc_macro/
drwxr-x--- 1 at at 42 2020-07-29 21:17 profiler_builtins/
drwxr-x--- 1 at at 36 2020-07-29 21:17 rtstartup/
drwxr-x--- 1 at at 32 2020-07-29 21:17 rustc-std-workspace-alloc/
drwxr-x--- 1 at at 50 2020-07-29 21:17 rustc-std-workspace-core/
drwxr-x--- 1 at at 50 2020-07-29 21:17 rustc-std-workspace-std/
drwxr-x--- 1 at at 66 2020-07-29 21:17 std/
drwxr-x--- 1 at at 234 2020-07-29 21:17 stdarch/
drwxr-x--- 1 at at 26 2020-07-29 21:17 term/
drwxr-x--- 1 at at 26 2020-07-29 21:17 test/
drwxr-x--- 1 at at 42 2020-07-29 21:17 unwind/
Reacted by Jonas Schievink, Laurențiu Nicola, Jiayi Hu and Amjad Alsharafi
Metadata
Metadata
Assignees
Labels
No labels
Activity
jonas-schievink commentedon Jul 29, 2020
I was wondering why it stopped resolving
stdpaths... Fallout from rust-lang/rust#73265Merge #5586
jonas-schievink commentedon Jul 30, 2020
Hmm, this still seems to be broken when editing on rustc
lnicola commentedon Jul 31, 2020
Do you think that's related to this issue or to the fix in #5586? I'm not sure how it finds the
rust-lang/ruststdlib.jonas-schievink commentedon Jul 31, 2020
Not sure either, I haven't looked into this yet. There's no error message from rust-analyzer though.
jonas-schievink commentedon Jul 31, 2020
Ah, looks like this was a local problem. I had
RUST_SRC_PATHset tosrcin my Rust checkout.