Skip to content

Overzealous uninlined_format_args #14686

Open
@sebschmi

Description

@sebschmi

Description

Consider this snippet from a match statement:

Self::TemplateSwitchExit {
    entrance_reference_index,
    entrance_query_index,
    template_switch_primary,
    template_switch_secondary,
    primary_index,
    anti_primary_gap,
} => write!(
    f,
    "TemplateSwitchExit({}R, {}Q, {}P, {}G, {}, {})",
    entrance_reference_index,
    entrance_query_index,
    primary_index,
    anti_primary_gap,
    template_switch_primary,
    template_switch_secondary
),

Clippy wants me to put all format args into the string, but that would make the string incredibly long. cargo fmt would not break up the string into multiple lines either.

I think the code is easier to read like this. Clippy should not suggest inlining format args if the resulting string gets too long.

Version

rustc 1.88.0-nightly (df35ff6c3 2025-04-23)
binary: rustc
commit-hash: df35ff6c354f1f1fbf430b84e7dea37dfe997f34
commit-date: 2025-04-23
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions