Use Clippy built on my local machine
This is a note about the way to use Clippy built on my local machine. It's helpful when checking the implementation of new lints, and finding some bugs and false positives.
- Build Clippy
$ cargo build
- Set the
LD_LIBRARY_PATH
and run Clippy on the repository which I want to do for
$ LD_LIBRARY_PATH=$(rustc --print sysroot)/lib path/to/rust-clippy/target/debug/cargo-clippy --all-targets --all-features -- -Wclippy::all
- Oh, at the time of writing this note, I may need to set the toolchain same as the one Clippy use (see
rust-toolchain
file in Clippy repo). Anyway, I overrode it.
$ rustup override set nightly-2021-02-25
- Clippy works on my local machine!