ignore redundant_pub_crate in useless_attribute

This commit is contained in:
Alex Macleod 2022-04-23 12:23:18 +01:00
parent cef882cc9d
commit 0c164bbfdb
4 changed files with 19 additions and 8 deletions

View file

@ -57,6 +57,12 @@ pub use std::io::prelude::*;
#[allow(clippy::enum_glob_use)]
pub use std::cmp::Ordering::*;
// don't lint on clippy::redundant_pub_crate
mod c {
#[allow(clippy::redundant_pub_crate)]
pub(crate) struct S;
}
fn test_indented_attr() {
#![allow(clippy::almost_swapped)]
use std::collections::HashSet;

View file

@ -57,6 +57,12 @@ pub use std::io::prelude::*;
#[allow(clippy::enum_glob_use)]
pub use std::cmp::Ordering::*;
// don't lint on clippy::redundant_pub_crate
mod c {
#[allow(clippy::redundant_pub_crate)]
pub(crate) struct S;
}
fn test_indented_attr() {
#[allow(clippy::almost_swapped)]
use std::collections::HashSet;

View file

@ -13,7 +13,7 @@ LL | #[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![cfg_attr(feature = "cargo-clippy", allow(dead_code)`
error: useless lint attribute
--> $DIR/useless_attribute.rs:61:5
--> $DIR/useless_attribute.rs:67:5
|
LL | #[allow(clippy::almost_swapped)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(clippy::almost_swapped)]`