Skip to content

Commit 14f9f2b

Browse files
lint::unsafe_removed_from_name: fix false positive result when allowed
* Allowing `unsafe_removed_from_name` on imports produces a false positive on `useless_attribute`. Fixes: #9197 Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 425e1ea commit 14f9f2b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clippy_lints/src/attrs.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
357357
"wildcard_imports"
358358
| "enum_glob_use"
359359
| "redundant_pub_crate"
360-
| "macro_use_imports",
360+
| "macro_use_imports"
361+
| "unsafe_removed_from_name",
361362
)
362363
})
363364
{

tests/ui/unsafe_removed_from_name.rs

+3
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ use mod_with_some_unsafe_things::Unsafe as LieAboutModSafety;
2424
use mod_with_some_unsafe_things::Safe as IPromiseItsSafeThisTime;
2525
use mod_with_some_unsafe_things::Unsafe as SuperUnsafeModThing;
2626

27+
#[allow(clippy::unsafe_removed_from_name)]
28+
use mod_with_some_unsafe_things::Unsafe as SuperSafeThing;
29+
2730
fn main() {}

0 commit comments

Comments
 (0)