Skip to content

error[internal]: left behind trailing whitespace #5599

@LittleGuest

Description

@LittleGuest

Hi, I'm having a problem with cargo fmt , like this:

error[internal]: left behind trailing whitespace
 --> /playground/src/main.rs:5:5:1
  |
5 |         
  | ^^^^^^^^
  |

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

code looks like this:

fn main() {
    let a = Some(1);
    let Some(a) = a else{
        panic!("none");
        
    };
    println!("{a}");
}

rustc 1.65.0
rustfmt 1.5.1-stable (897e3755 2022-11-02)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions