- add this crate as dependency on Cargo.toml
- add
#![plugin(lints)]
to your crate root like <examples/compiler_plugin.rs> - cargo check # would apply lints from plugin crate
cargo test -- --nocapture
in rust project directory you want to analyze
compile lints package rustc_ binary and set env RUSTC to rustc_ binary path, e.g. mac/linux:
RUSTC=/path/to/rustc_ cargo check
- add f32 cast to f64 precession lost lint(check f32 cast to f64 and warn precession lost(clippy::pedantic has
f64 as f32
checking)) - add ui_test similar to dylint::ui_test or rustc/clippy ui_test
- use a readable diff tool for ui test, better than dtolnay/dissimilar used by rust-analyzer