9
votes

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_PATHenvironment 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?

2
What does ls -l /usr/local/bin/rustc tell you?tckmn
It tells me: ` ls -l /usr/local/bin/rustc -rwxr-xr-x 1 root root 2889 Nov 24 13:24 /usr/local/bin/rustc`krishnab
There is a ~/.multirust/toolchains/stable/bin folder in my home directory. Would that be the correct one to use. There is a rustc and a cargo file in there.krishnab
Re: your first comment, that means that it's not a symlink. The .multirust directory does sound promising.tckmn

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).