I installed the multirust
version of the Rust programming language. I was trying to configure the racer
code completion package to point to the Rust source code through the RUST_SRC_PATH
environment variable. However, I can't seem to find the location of the rust source files. When I type which rustc
I am pointed to /usr/local/bin
probably because there is a symlink to the actual source directory or something. Any info on where the proper directory for the RUST_SRC_PATH
variable is for multirust
?
9
votes
2 Answers
14
votes
By default, rustup doesn't install the source code for the Rust standard library. But you can execute the following command to install it:
$ rustup component add rust-src
The source is installed in ~/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/src/rust/src/
(where $TOOLCHAIN
is the name of a toolchain you use).
6
votes
Currently, multirust doesn't install the source. This is also mentioned in the context of using racer with multirust.
Instead, follow the instructions in the Racer README:
Fetch the Rust sourcecode from git, or download from https://www.rust-lang.org/install.html
ls -l /usr/local/bin/rustc
tell you? – tckmn~/.multirust/toolchains/stable/bin
folder in my home directory. Would that be the correct one to use. There is arustc
and acargo
file in there. – krishnab.multirust
directory does sound promising. – tckmn