Skip to content

Bug: rustfmt complains that fn_call_width is bigger than max_width when it isn't #6074

@bergkvist

Description

@bergkvist

When running cargo fmt, I get the following warning message printed out to my terminal:

`fn_call_width` cannot have a value that exceeds `max_width`. `fn_call_width` will be set to the same value as `max_width`

rust version 1.78.0-nightly (ee9c7c940 2024-02-14)

The following macro somehow triggers the warning:

mod a {
    macro_rules! b {
        () => {};
    }
}

When you have a .rustfmt.toml config set up file like this:

max_width = 100
fn_call_width = 90

Increasing max_width to 102, or changing the macro to the following will make the warning go away:

mod a {
    macro_rules! b {
        () => {{}};
    }
}

See this repo for how to reproduce:
https://github.com/bergkvist/rustfmt-bug

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