Skip to content

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

@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-macrosArea: macros (procedural macros, macro_rules! macros, etc.)C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions