Skip to content

Divergent case: rustfmt increases indentation on each invocation in rustfmt::skip'd block #5555

Open
@horazont

Description

@horazont

In the following example, rustfmt increases the indentation of the line with }); by one level each time it is run:

macro_rules! pwm_timer_init {
    ($tim:expr) => {{
        let tim = $tim;
        #[rustfmt::skip]
        tim.ccmr1_output().write(|w| {
            w
                .oc1pe().enabled()
                .oc1m().pwm_mode1()
                .oc2pe().enabled()
                .oc2m().pwm_mode1()
        });
    }};
}

This is also visible in the nightly version of the playground, though I found it with rustfmt 1.5.1-stable (4b91a6e 2022-08-08).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions