Merge pull request #2611 from phansch/improve_readme

Readme: Explain nightly install and clippy update
This commit is contained in:
Oliver Schneider 2018-04-02 12:12:02 +02:00 committed by GitHub
commit fef7fb3473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,12 @@ as an included feature during build. All of these options are detailed below.
As a general rule clippy will only work with the *latest* Rust nightly for now.
To install Rust nightly, the recommended way is to use [rustup](https://rustup.rs/):
```terminal
rustup install nightly
```
### As a cargo subcommand (`cargo clippy`)
One way to use clippy is by installing clippy through cargo as a cargo
@ -48,6 +54,13 @@ cargo +nightly install clippy
Now you can run clippy by invoking `cargo +nightly clippy`.
To update the subcommand together with the latest nightly use the [rust-update](rust-update) script or run:
```terminal
rustup update nightly
cargo +nightly install --force clippy
```
In case you are not using rustup, you need to set the environment flag
`SYSROOT` during installation so clippy knows where to find `librustc` and
similar crates.
@ -191,7 +204,7 @@ You can add options to `allow`/`warn`/`deny`:
Note: `deny` produces errors instead of warnings.
For convenience, `cargo clippy` automatically defines a `cargo-clippy`
features. This lets you set lints level and compile with or without clippy
feature. This lets you set lint levels and compile with or without clippy
transparently:
```rust