Skip to content

rustfmt removes a block comment in an argument position #2976

@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-commentsArea: commentsC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions