Skip to content

Error when formatting if let with && #5863

Description

@momvart

If we chain multiple if let blocks into a single one with &&, rustfmt fails to format or gives

error[internal]: left behind trailing whitespace

Example:

fn main() {
    let x = Some(10);
    let y = None;

    if let Some(x) = x 
&& let Some(y) = y {
        println!("Hi");
    }
}

Version: 1.6.0-nightly (2023-07-27 500647f)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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