A virtual environment tool similar to Python's virtual environments.
pip install cargo-venv
Leveraging Cargo
's built-in command mechanism, you can simply call the following command to get a virtual environment called
venv
.
cargo venv
However, since this is a Python script, you can specify a different name by calling:
cargo-venv custom-name
You can also specify a custom toolchain rather than always depend on the latest. If a rust-toolchain
file is discovered
in your project, that version will be used to install the toolchain inside your virtual environment.
Under Settings > Languages and Frameworks > Rust
set the following fields to these values:
<venv-path>/.rustup/toolchains/<toolchain-version>/bin
<venv-path>/.rustup/toolchains/<toolchain-version>/lib/rustlib/src/rust