Skip to content

Incorrect comment indent inside if/else #4120

@dhardy

Description

@dhardy

Example:

fn main() {
    let x = if true {
        1
    // comment with wrong indent
    } else {
        0
    };
}

(And no, this definitely should not be a comment on the else — actually, it should not be rustfmt's decision whether this applies to the else or is a free comment after the 1.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions