Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive for the useless_attribute rule #5918

Closed
recmo opened this issue Aug 17, 2020 · 1 comment · Fixed by #5994
Closed

False positive for the useless_attribute rule #5918

recmo opened this issue Aug 17, 2020 · 1 comment · Fixed by #5994
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy

Comments

@recmo
Copy link

recmo commented Aug 17, 2020

I tried this code:

#[allow(clippy::wildcard_imports)]
use std::prelude::v1::*;

I expected to see this happen: explanation

Nothing, since this is an exception to the wildcard_imports rule, required because of #5917.

Instead, this happened: explanation

error: useless lint attribute
 --> utils/mmap-vec/src/mmap_vec.rs:5:1
  |
5 | #[allow(clippy::wildcard_imports)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(clippy::wildcard_imports)]`
  |
  = note: `-D clippy::useless-attribute` implied by `-D warnings`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute

Meta

  • cargo clippy -V: clippy 0.0.212 (7e6d6e5 2020-08-16)
  • rustc -Vv:
    rustc 1.47.0-nightly (7e6d6e5f5 2020-08-16)
    binary: rustc
    commit-hash: 7e6d6e5f535321c2223f044caba16f97b825009c
    commit-date: 2020-08-16
    host: x86_64-apple-darwin
    release: 1.47.0-nightly
    LLVM version: 10.0
    
Backtrace

<backtrace>

@recmo recmo added the C-bug Category: Clippy is not doing the correct thing label Aug 17, 2020
@recmo
Copy link
Author

recmo commented Aug 17, 2020

Same for #[allow(clippy::enum_glob_use)]

@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels Aug 18, 2020
@bors bors closed this as completed in 8829214 Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants