Skip to content

warning: empty trait list in derive should not emit if created by a macro #54652

Closed
@Havvy

Description

@Havvy

The following code should not emit a warning at the call site of the macro:

#![crate_type="lib"]

macro_rules! ds {
    () => (#[derive()] struct StructDs;)
}

ds!{}

Currently, it does:

warning: empty trait list in `derive`
  --> src/lib.rs:8:12
   |
8  |     () => (#[derive()] struct StructDs;)
   |            ^^^^^^^^^^^
...
11 | ds!{}
   | ----- in this macro invocation

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions