This wrapper automatically sets the RUST_SRC_DIRECTORY
environment variable for whatever rust compiler is currently active, automatically creating a new checkout whenever necessary. This should be compatible with all of the multirust-alike tools, but it has only been tested with rustup.rs
Simply place this somewhere on your path before the main racer binary and set the execute bit.
See rm(1)
.
If you keep up to date with nightly, this will likely result in your disk slowly filling with copies of the rust source tree. While there are far worse uses for the disk space, you also likely have better. You may simply delete all directories beginning with rust-
in $RUST_SOURCE_ROOT
(${RUSTUP_HOME}/src
or ${HOME}/.multirust/src
, whichever is defined) to reclaim the disk space. (Strictly speaking, you can also remove the git directory, but it will automatically be redownloaded the next time the wrapper is run so this usually doens't make sense.)