Skip to content

The useless attribute lint doesn't put the ! in the right place. #1522

Open
@BookOwl

Description

@BookOwl

When the useless_attribute lint is activated, it says that you most likely forgot an exclamation mark (!). While this is true, it also suggests to stick the ! in the middle of the attribute:

warning: useless lint attribute, #[warn(useless_attribute)] on by default
 --> src/lib.rs:1:38
  |
1 | #[cfg_attr(feature = "cargo-clippy", allow(new_without_default))]
  |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
help: if you just forgot a `!`, use
  | #[cfg_attr(feature = "cargo-clippy", a!llow(new_without_default))]
  = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#useless_attribute

The correct response should be to suggest adding it after the #
I'm using the latest clippy on the latest nightly Rust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingE-hardCall for participation: This a hard problem and requires more experience or effort to work on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions