Skip to content

Cargo clippy --fix not working with 1.80.1 #13258

Closed
@psibi

Description

@psibi

Summary

The command cargo clippy --fix --allow-dirty is not working as expected with 1.80.1.

Reproducer

I tried this code on a fresh project:

fn main() {
    let f = 1;
}

I expected the file to modify like this when I run cargo clippy --fix --allow-dirty:

fn main() {
    let _f = 1;
}

Instead the file was still this:

fn main() {
    let f = 1;
}

Infact, I confirmed that this was not the behavior in 1.76.0 and everything was working as expected there.

Version

❯ rustc -Vv
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
binary: rustc
commit-hash: 3f5fd8dd41153bc5fdca9427e9e05be2c767ba23
commit-date: 2024-08-06
host: x86_64-unknown-linux-gnu
release: 1.80.1
LLVM version: 18.1.7

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions