Skip to content

rustfmt deletes comments inbetween semicolons #4018

Closed
@CGMossa

Description

@CGMossa

Two issues I found while messing with this, first

fn main() {
    println!("Hello World! I think rustfmt deletes comments between two semicolons.");
    //if you run rustfmt..
    //these 
    //lines will disappear!
    //delete me!!
    ;
}

See playground.

And rustfmt panics if you have a block-comment inside two semicolons, like

fn main() {
    ;/* rustfmt panics!*/;
}

See playground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsbugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions