-
Notifications
You must be signed in to change notification settings - Fork 48
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
RUST_SRC_PATH error on first init #85
Comments
I set the variable to "" (empty string) and RUST_SRC_PATH was implicitly set.
Does it mean when I change the environment with rustup I will have to update the racer-rust-src-path to? |
Sorry, I'm slightly confused by which variables you're setting. Had you explicitly set the elisp variable (You can view this This is probably obvious, but
If you really want to see the exact source code of the stdlib when you jump to a definition, yes. I don't generally bother changing it, I'm happy with it always pointing to nightly's stdlib code. |
I have not set RUST_SRC_PATH explicitly (and I checked, it wasn't in my ENV), so it wasn't set in emacs either. I then set the racer-rust-src-path to "" (as I assumed it will be deduced automatically when the mode is engaged) but I get the error and racer-debug produces the output in the original post. I expected if I reset "racer-rust-src-path" to be empty, it will be reset to the output of I think it fails on this promise (from customise-variable racer-rust-src-path)
|
Note that an empty string is truthy in elisp, so you should set the variable to nil if you want to reset it. |
@alex-glv I just went through the same exercise. Setting the path to |
I was just getting racer set up and hit this issue too. In the hopes I may give someone else a workaround, here's what I did:
(setq racer-rust-src-path
(concat (string-trim
(shell-command-to-string "rustc --print sysroot"))
"/lib/rustlib/src/rust/src")) I use (use-package racer
:requires rust-mode
:init (setq racer-rust-src-path
(concat (string-trim
(shell-command-to-string "rustc --print sysroot"))
"/lib/rustlib/src/rust/src"))
:config
(add-hook 'rust-mode-hook #'racer-mode)
(add-hook 'racer-mode-hook #'eldoc-mode)
(add-hook 'racer-mode-hook #'company-mode)) |
add (require 'subr-x) to use string-trim for someone occur this error |
Helped me: |
Prior to running the project, I checked that src is installed, and I get sources under
From the description of Racer Rust Src Path it says:
If $RUST_SRC_PATH is not set, look for rust source in rustup’s install directory.
Which I expected to happen, but on first completion attempt racer-debug claims that var exported is
Is it expected behaviour?
Thanks!
The text was updated successfully, but these errors were encountered: