Skip to content

rustfmt removes a block comment in an argument position #2976

Closed
@ozkriff

Description

@ozkriff

Input:

fn a(_ /*comment*/: u8) {}
fn b(/*comment*/ _: u8) {}

fn main() {}

Expected output (no changes):

fn a(_ /*comment*/: u8) {}
fn b(/*comment*/ _: u8) {}

fn main() {}

Real output (on of the comments is removed):

fn a(_: u8) {}
fn b(/*comment*/ _: u8) {}

fn main() {}

Replacing _ with normal identifier doesn't help.

I guess it's related to #1096.

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