Skip to content

Commit 17f89e7

Browse files
committed
Fix useless_attribute FP on exported_private_dependencies lint attributes.
1 parent 1b33602 commit 17f89e7

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

clippy_lints/src/attrs/useless_attribute.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub(super) fn check(cx: &EarlyContext<'_>, item: &Item, attrs: &[Attribute]) {
3131
| sym::dead_code
3232
| sym::deprecated
3333
| sym::deprecated_in_future
34+
| sym::exported_private_dependencies
3435
| sym::hidden_glob_reexports
3536
| sym::unreachable_pub
3637
| sym::unused

clippy_utils/src/sym.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ generate! {
147147
exp,
148148
expect_err,
149149
expn_data,
150+
exported_private_dependencies,
150151
extend,
151152
filter,
152153
filter_map,

tests/ui/useless_attribute.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ mod foo {
4242
#[allow(deprecated)]
4343
pub use foo::Bar;
4444

45+
// don't lint on exported_private_dependencies for `use` items
46+
#[allow(exported_private_dependencies)]
47+
use {};
48+
4549
// This should not trigger the lint. There's lint level definitions inside the external derive
4650
// that would trigger the useless_attribute lint.
4751
#[derive(DeriveSomething)]

tests/ui/useless_attribute.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ mod foo {
4242
#[allow(deprecated)]
4343
pub use foo::Bar;
4444

45+
// don't lint on exported_private_dependencies for `use` items
46+
#[allow(exported_private_dependencies)]
47+
use {};
48+
4549
// This should not trigger the lint. There's lint level definitions inside the external derive
4650
// that would trigger the useless_attribute lint.
4751
#[derive(DeriveSomething)]

0 commit comments

Comments
 (0)