Skip to content

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

Closed
@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-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