racer-rust / emacs-racer

Racer support for Emacs
399 stars 48 forks source link

Fresh install and getting path error on finding RUST_SRC_PATH? #114

Closed fxfactorial closed 5 years ago

fxfactorial commented 5 years ago

Just got started with rust for first time.

Installed rustup via the main rust website .sh script,

did rustup toolchain add nightly, then cargo +nightly install racer

Now trying to use in emacs and get this error:

Company: backend company-capf user-error: No such directory: /Users/edgar/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src. Please set ‘racer-rust-src-path’ or ‘RUST_SRC_PATH’

value of racer-rust-src-path:

ELISP> racer-rust-src-path "/Users/edgar/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src"

But this is odd because in /Users/edgar/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib

I only have:

 ls
components                             manifest-rust-docs-x86_64-apple-darwin multirust-channel-manifest.toml        x86_64-apple-darwin
etc                                    manifest-rust-std-x86_64-apple-darwin  multirust-config.toml
manifest-cargo-x86_64-apple-darwin     manifest-rustc-x86_64-apple-darwin     rust-installer-version

and similarly so for the other toolchain, the nightly one.

kngwyu commented 5 years ago

I think you just need

rustup component add rust-src
fxfactorial commented 5 years ago

Amazing, you're right, that fixed it! Thanks!