Skip to content

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

Closed

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

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    on Sep 28, 2018
  2. changed the title [-]warning: empty trait list in `derive` should not fired if created by a macro[/-] [+]warning: empty trait list in `derive` should not fire if created by a macro[/+] on Sep 28, 2018
  3. changed the title [-]warning: empty trait list in `derive` should not fire if created by a macro[/-] [+]warning: empty trait list in `derive` should not emit if created by a macro[/+] on Sep 28, 2018
  4. added
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on Dec 26, 2019
  5. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 11, 2020
  6. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    and removed
    A-diagnosticsArea: Messages for errors, warnings, and lints
    on Dec 28, 2024
  7. fmease commented on Dec 28, 2024

    @fmease
    Member

    Since #79078, #[derive()] no longer triggers a lint anywhere / at all. Closing as (coincidentally) fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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