racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 278 forks source link

New install of racer failing, suspected RUST_SRC_PATH problem #1133

Closed thor314 closed 3 years ago

thor314 commented 3 years ago

New install of racer, failing to work as intended. Is this an export RUST_SRC_PATH=blah in .zshrc type fix? after on command line: racer complete std::io::B

racer-debug returns:

$ cd /home/thor/r/imp/
$ export CARGO_HOME=/home/thor/.cargo
$ export RUST_SRC_PATH=/home/thor/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
$ /home/thor/.cargo/bin/racer complete 3 0 /home/thor/r/imp/src/main.rs /tmp/racerpJLTIq

This command terminated with exit code 1.

stdout:

Unable to find libstd under RUST_SRC_PATH. N.B. RUST_SRC_PATH variable needs to point to the *src* directory inside a rust checkout e.g. "/home/foouser/src/rust/src". Current value ""/home/thor/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd""

Process *async-racer* exited abnormally with code 1

stderr:

Process *async-racer* stderr finished
chama-chomo commented 3 years ago

same here

racer 2.1.39 rustup 1.22.1 nightly-x86_64-unknown-linux-gnu - Up to date : 1.49.0-nightly (91a79fb29 2020-10-07) Manjaro Linux

chama-chomo commented 3 years ago

@thor314 can you try this? see #1117

export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/library"

thor314 commented 3 years ago

@chama-chomo that appears to work. Much obliged.