Skip to content

Rustfmt adds new indentation every time it formats let else in macro declaration #5503

Closed as not planned
@PoignardAzur

Description

@PoignardAzur

Example code:

// The indentation stays the same, as expected
fn foobar() {
    let x = y else {
        panic!();
    };
}

// The indentation is increased every time you run `cargo fmt`
macro_rules! foobar {
    () => {
        let pat = expr else {
                    panic!();
                };
    };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-macrosbugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions