diff options
| author | Philipp Krones <hello@philkrones.com> | 2025-05-09 13:06:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-09 13:06:10 +0000 |
| commit | 4a6490364007febb883f3a0545a6a41d7b53b7fb (patch) | |
| tree | cf5693f2ef3784089772d65907e41775b94781c4 | |
| parent | d8726caacc5240b322591fce776759543b833251 (diff) | |
| parent | 33f81c08aaa5701e66cad9aa3d527a683c929adc (diff) | |
| download | rust-4a6490364007febb883f3a0545a6a41d7b53b7fb.tar.gz rust-4a6490364007febb883f3a0545a6a41d7b53b7fb.zip | |
Use `cargo dev setup toolchain` in install from source docs (#14766)
changelog: none
| -rw-r--r-- | book/src/development/basics.md | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/book/src/development/basics.md b/book/src/development/basics.md index 4219724ed5d..cdbbe76bdb0 100644 --- a/book/src/development/basics.md +++ b/book/src/development/basics.md @@ -145,42 +145,32 @@ unclear to you. If you are hacking on Clippy and want to install it from source, do the following: -First, take note of the toolchain -[override](https://rust-lang.github.io/rustup/overrides.html) in -`/rust-toolchain.toml`. We will use this override to install Clippy into the right -toolchain. - -> Tip: You can view the active toolchain for the current directory with `rustup -> show active-toolchain`. - From the Clippy project root, run the following command to build the Clippy -binaries and copy them into the toolchain directory. This will override the -currently installed Clippy component. +binaries and copy them into the toolchain directory. This will create a new +toolchain called `clippy` by default, see `cargo dev setup toolchain --help` +for other options. ```terminal -cargo build --release --bin cargo-clippy --bin clippy-driver -Zunstable-options --out-dir "$(rustc --print=sysroot)/bin" +cargo dev setup toolcahin ``` -Now you may run `cargo clippy` in any project, using the toolchain where you -just installed Clippy. +Now you may run `cargo +clippy clippy` in any project using the new toolchain. ```terminal cd my-project -cargo +nightly-2021-07-01 clippy +cargo +clippy clippy ``` ...or `clippy-driver` ```terminal -clippy-driver +nightly-2021-07-01 <filename> +clippy-driver +clippy <filename> ``` -If you need to restore the default Clippy installation, run the following (from -the Clippy project root). +If you no longer need the toolchain it can be uninstalled using `rustup`: ```terminal -rustup component remove clippy -rustup component add clippy +rustup toolchain uninstall clippy ``` > **DO NOT** install using `cargo install --path . --force` since this will |
