Skip to content

cargo clippy and cargo clippy --fix --allow-dirty have different reports #13527

Open

Description

Problem

I ran cargo clippy and cargo clippy --fix --allow-dirty in the same project but got different reports.

  1. cargo clippy
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
  1. cargo clippy --fix --allow-dirty
    Checking cargo-information v0.4.2 (/Volumes/t7/code/cargo-information)
       Fixed tests/testsuite/cargo_information/git_dependency/mod.rs (1 fix)
warning: use of a disallowed/placeholder name `baz`
 --> tests/testsuite/cargo_information/git_dependency/mod.rs:9:9
  |
9 |     let baz = git::new("baz", |project| {
  |         ^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
  = note: `#[warn(clippy::disallowed_names)]` on by default

warning: use of a disallowed/placeholder name `foo`
  --> tests/testsuite/cargo_information/git_dependency/mod.rs:15:9
   |
15 |     let foo = project()
   |         ^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names

warning: `cargo-information` (test "testsuite") generated 2 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.78s

Steps

  1. Clone https://github.com/hi-rustin/cargo-information
  2. Rustup: rustup toolchain install nightly-2024-02-21
  3. cargo clippy and check the result
  4. cargo clippy --fix --allow-dirty and check the result

Possible Solution(s)

None

Notes

I am willing to investigate and fix this issue.

Version

Cargo:

workspace git:(draft/mystifying-neco) ✗ cargo --version
cargo 1.78.0-nightly (7b7af3077 2024-02-17)

Toolchain:

active toolchain
----------------

nightly-2024-02-21-x86_64-unknown-linux-gnu (default)
rustc 1.78.0-nightly (bb594538f 2024-02-20)

Clippy:

workspace git:(draft/mystifying-neco) ✗ cargo clippy --version
clippy 0.1.78 (bb59453 2024-02-20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)C-bugCategory: bugCommand-clippyCommand-fixS-needs-team-inputStatus: Needs input from team on whether/how to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions