Skip to content

malformed derive attribute input deletes derive arguments #4545

Closed
@ratmice

Description

@ratmice

Describe the bug
Adding a generic type to a derive macro deletes all derives

To Reproduce

cat <<EOF | rustfmt
#[derive(Debug, Foo<T>)]
enum Bar{}
EOF 

This produces the following output, removing all derive attributes:

#[derive()]
enum Bar {}

Expected behavior
Something less nefarious, like rustc's

error: malformed `derive` attribute input

Meta

  • rustfmt version: rustrustfmt 1.4.24-stable (eb894d5 2020-11-05)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: In an editor with undo hopefully 😈

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions