- Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-uiArea: Clippy interface, usage and configurationArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
Summary
While the --cap-lints
flag is correctly taken into account when using cargo clippy
, it is ignored when using cargo clippy --fix
.
I'm not sure if the unexpected behaviour comes from the clippy driver or from rustfix
, but passing the flags directly using RUSTFLAGS
work as intended.
Reproducer
I tried this code:
pub struct Foo; impl Foo { pub fn new() -> Foo { // new_without_default AND use_self Self } } fn main() { let a: u8; // unused_variables }
running: cargo clippy --fix -- --cap-lints=allow
I expected to see this happen:
Nothing, same behaviour as for RUSTFLAGS="--cap-lints=allow" cargo clippy --fix
Instead, this happened:
Suggestions were applied
Version
rustc 1.64.0 (a55dd71d5 2022-09-19) binary: rustc commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52 commit-date: 2022-09-19 host: aarch64-apple-darwin release: 1.64.0 LLVM version: 14.0.6
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
A-uiArea: Clippy interface, usage and configurationArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing