Skip to content

Document how to use rust-toolchain.toml to avoid breaking changes (e.g. in CI) #14803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions book/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ If Clippy was not installed for a toolchain, it can be installed with
$ rustup component add clippy [--toolchain=<name>]
```

### Use a specific version of Clippy

Clippy may introduce new warnings and errors between associated Rust versions.
This may be desirable if you want to learn about newly detectable issues in your
codebase over time, but it can cause [continuous integration](./continuous_integration/index.md)
to fail even if you haven't touched your Rust code. If you'd like to keep Clippy's
behaviour stable for your project, use
[`rust-toolchain.toml`](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file)
to pin your entire Rust toolchain. For example:

```toml
[toolchain]
channel = "1.83.0"
components = ["clippy"]
```

## From Source

Take a look at the [Basics] chapter in the Clippy developer guide to find step-by-step
Expand Down