Skip to content

Extra spaces not removed in let-else statements #5585

Closed as not planned
Closed as not planned
@adamchalmers

Description

@adamchalmers

I think this is a bug. Consider this program playground

fn main() {
    let x: Option<i32> = None;
    let Some(y) = x       else {
        return;
    };
    println!("{y}");
}

I think the extra spaces on line 3, between x and else, should be removed by rustfmt. But on current stable they aren't.

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