Skip to content

Commit 84fa9db

Browse files
Add test allow lint on import
1 parent 4313093 commit 84fa9db

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/ui/anon_trait_imports.fixed

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,17 @@ mod allow_lint_mod {
261261
}
262262
}
263263

264+
mod allow_lint_import {
265+
// False positive for useless_attribute
266+
#[allow(clippy::useless_attribute)]
267+
#[allow(clippy::anon_trait_imports)]
268+
use std::any::Any;
269+
270+
fn foo() {
271+
"foo".type_id();
272+
}
273+
}
274+
264275
// Limitation: Suggests `use std::any::Any as _::{self};` which looks weird
265276
// fn use_trait_self_good() {
266277
// use std::any::Any::{self};

tests/ui/anon_trait_imports.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,17 @@ mod allow_lint_mod {
261261
}
262262
}
263263

264+
mod allow_lint_import {
265+
// False positive for useless_attribute
266+
#[allow(clippy::useless_attribute)]
267+
#[allow(clippy::anon_trait_imports)]
268+
use std::any::Any;
269+
270+
fn foo() {
271+
"foo".type_id();
272+
}
273+
}
274+
264275
// Limitation: Suggests `use std::any::Any as _::{self};` which looks weird
265276
// fn use_trait_self_good() {
266277
// use std::any::Any::{self};

0 commit comments

Comments
 (0)