Skip to content

Warning about missing dyn in #[ derive() ] #52135

@najamelan

Description

@najamelan
warning: trait objects without an explicit `dyn` are deprecated>                                                                      
  -->
26 | #[ derive( Copy, Clone, Eq, PartialEq, Debug, Fail ) ]
   |                                               ^^^^ help: use `dyn`: `dyn (Fail)`
note: lint level defined here
  --> ...path
   |
1  | #![ warn   ( rust_2018_idioms  ) ] // Opt in to warnings about new 2018 idioms
   |              ^^^^^^^^^^^^^^^^
   = note: #[warn(bare_trait_objects)] implied by #[warn(rust_2018_idioms)]

This looks wrong to me, and the suggestion doesn't even compile either. Does the warning check whether we are in an attribute?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions