Skip to content

cargo fix doesn't apply suggestions from mismatched_lifetime_syntaxes #144588

Description

@kornelski

Rust is about to start warning about this by default, which can trigger a lot of warnings, but unfortunately the warnings can't be fixed automatically:

#![warn(mismatched_lifetime_syntaxes)]

fn lifetimes(x: &str) -> std::borrow::Cow<str> {
    x.into()
}

Running these commands has no effect:

cargo fix
cargo fix --broken-code
cargo clippy --fix
cargo clippy --fix --broken-code

The code remains unfixed, and the warning keeps triggering.


cargo 1.90.0-nightly (9b296973b 2025-07-25)
rustc 1.90.0-nightly (f8e355c 2025-07-27)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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