Closed kostafey closed 3 years ago
For now, just add
(setq racer-rust-src-path
"/YOUR/REAL/HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library")
to your emacs init file. Its a quick fix fix until the issue is resolved.
PR #141 suggests a fix.
A compatible version here #143.
Or you can add
(setq racer-rust-src-path
(let* ((sysroot (string-trim
(shell-command-to-string "rustc --print sysroot")))
(lib-path (concat sysroot "/lib/rustlib/src/rust/library"))
(src-path (concat sysroot "/lib/rustlib/src/rust/src")))
(or (when (file-exists-p lib-path) lib-path)
(when (file-exists-p src-path) src-path))))
Related issues #144
Hello,
I've seen that in my installation both directories exist, and in my case it complains because the std library is not in the expected directory.
Trying to have a more robust behaviour I've forked the main racer repository and added a patch so that it automatically detects if the old or new one should be used, by also checking if "std" library directory is there.
Also I have requested a merge applying my changes: https://github.com/racer-rust/emacs-racer/pull/149
Meanwhile, you can download a fixed races.el version which fixes the problem from here: https://github.com/rodested/emacs-racer
Quick fix:
download the races.el file
overwrite the one in (as per my installation): ~/.emacs.d/elpa/26.3/develop/racer-20210119.225 with the downloaded one
Hope this helps
Should be fixed in #143.
Fail with the following error:
eldoc error: (user-error No such directory: ~/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src. Please set ‘racer-rust-src-path’ or ‘RUST_SRC_PATH’)
Everything looks installed:
But I can't locate the last
src
directory in this path~/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/src
:Did I forget to install something or default
rust-src
path should be changed to~/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/library
?