Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unable to find libstd under RUST_SRC_PATH" #1137

Open
kfrncs opened this issue Oct 19, 2020 · 1 comment
Open

"Unable to find libstd under RUST_SRC_PATH" #1137

kfrncs opened this issue Oct 19, 2020 · 1 comment

Comments

@kfrncs
Copy link

kfrncs commented Oct 19, 2020

When I run racer complete std::io::B, I get this:

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

Despite the fact that my ~/.zshrc contains:

export RUST_SRC_PATH=${HOME}/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src

Any help would be appreciated.

@jsoverson
Copy link

On my setup anyway, rustup component add rust-src puts the source in "$(rustc --print sysroot)/lib/rustlib/src/rust/library". There is no src directory, but racer works when pointed to that library dir.

$ export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/library"
$ racer complete std::io::B
MATCH BufRead,1781,10,path.../rustlib/src/rust/library/std/src/io/mod.rs,Trait,pub trait BufRead: Read
MATCH Bytes,2397,11,path.../rustlib/src/rust/library/std/src/io/mod.rs,Struct,pub struct Bytes<R>
MATCH BufReader,53,11,path.../rustlib/src/rust/library/std/src/io/buffered.rs,Struct,pub struct BufReader<R>
MATCH BufWriter,448,11,path.../rustlib/src/rust/library/std/src/io/buffered.rs,Struct,pub struct BufWriter<W: Write>

YMMV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants