Skip to content

Syntax error after formatting a derive attribute that contains a block comment #4984

@SamRodri

Description

@SamRodri

Formatting this code:

#[derive(/*Debug, */Clone)]
struct Foo;

generates this syntax error:

#[derive(#[derive(/*Debug, */ Clone)]
struct Foo;

I tested rustfmt 1.4.37 stable and nightly.

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