Skip to content

Back-to-back match blocks causes error[internal]: left behind trailing whitespace #5624

Open
@betseg

Description

@betseg

Having back-to-back match blocks causes this problem:

fn func<F: Fn(u8) -> u8>(f: F) -> u8 {
    f(0)
}

fn main() {
    func(|x| 
        match x {
            x => x,
        } + match x {
            x => x,
        }
    );
}

results in

error[internal]: left behind trailing whitespace
 --> /playground/src/main.rs:6:6:13
  |
6 |     func(|x| 
  |             ^
  |

warning: rustfmt has failed to format. See previous 1 errors.


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions