Skip to content

rustfmt removes crucial code from macro calls (regression) #6424

Closed
@nazar-pc

Description

@nazar-pc

Probably related to #6418, but not 100% sure.

rustfmt recently started formatting code like this incorrectly:

frame_support::construct_runtime!(
    pub struct Test {
        System: frame_system = 0,
        SelfDomainId: pallet_domain_id = 1,
    }
);

Specifically, it removes = NUMBER for some reason, resulting in this:

frame_support::construct_runtime!(
    pub struct Test {
        System: frame_system,
        SelfDomainId: pallet_domain_id,
    }
);

This is incorrect and not an equivalent change.

Affected version:

rustfmt 1.8.0-nightly (426d173423 2024-12-21)

Version that I used previously and that worked correctly:

rustfmt 1.8.0-nightly (4392847410 2024-10-21)

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