parent
f9fe50da1e
commit
919feaaec5
2 changed files with 7 additions and 2 deletions
|
|
@ -110,9 +110,9 @@ impl LateLintPass for AttrPass {
|
|||
if let MetaItemKind::List(ref lint_list) = attr.value.node {
|
||||
match &*attr.name().as_str() {
|
||||
"allow" | "warn" | "deny" | "forbid" => {
|
||||
// whitelist `unused_imports`
|
||||
// whitelist `unused_imports` and `deprecated`
|
||||
for lint in lint_list {
|
||||
if is_word(lint, "unused_imports") {
|
||||
if is_word(lint, "unused_imports") || is_word(lint, "deprecated") {
|
||||
if let ItemUse(_) = item.node {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,4 +11,9 @@ extern crate clippy_lints;
|
|||
#[allow(unused_imports)]
|
||||
use std::collections;
|
||||
|
||||
// don't lint on deprecated for `use` items
|
||||
mod foo { #[deprecated] pub struct Bar; }
|
||||
#[allow(deprecated)]
|
||||
pub use foo::Bar;
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue