Skip to content

cargo fix doesn't apply fixes it suggests #142998

Closed
@xobs

Description

@xobs

When running cargo fix (or any cargo command, really) it often ends with this message:

warning: `[package]` (bin "[binary]") generated 6 warnings (run `cargo fix --bin "[binary]"` to apply 5 suggestions)

However, doing so does not appear to actually apply any fixes. In fact, the above message came about as a result of running cargo fix.

I tried this code:

git clone --depth 1 --revision abbf996695d645b81a046b9451544a15a8bfeb27 https://github.com/probe-rs/probe-rs.git
cd probe-rs
cargo +nightly fix

I expected to see this happen: The lifetime warnings mentioned should be fixed

Instead, this happened: The repository is unchanged

Meta

rustc +nightly --version --verbose:

rustc 1.90.0-nightly (28f1c8079 2025-06-24)
binary: rustc
commit-hash: 28f1c807911c63f08d98e7b468cfcf15a441e34b
commit-date: 2025-06-24
host: aarch64-apple-darwin
release: 1.90.0-nightly
LLVM version: 20.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`L-mismatched_lifetime_syntaxesLint: mismatched_lifetime_syntaxesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions