diff options
| author | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-09-10 00:10:05 +0800 |
|---|---|---|
| committer | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-09-10 00:10:05 +0800 |
| commit | 7e7ce10e5b0474e6833c22062c4973f447ca6463 (patch) | |
| tree | e4b86600d3558d02c37e148ab93c53084b6707a2 | |
| parent | 368b2355797b13511776f0a35ec4864468b87ece (diff) | |
| download | rust-7e7ce10e5b0474e6833c22062c4973f447ca6463.tar.gz rust-7e7ce10e5b0474e6833c22062c4973f447ca6463.zip | |
fix: `useless_attribute` FP on `deprecated_in_future`
| -rw-r--r-- | clippy_lints/src/attrs/useless_attribute.rs | 1 | ||||
| -rw-r--r-- | clippy_utils/src/sym.rs | 1 | ||||
| -rw-r--r-- | tests/ui/useless_attribute.fixed | 10 | ||||
| -rw-r--r-- | tests/ui/useless_attribute.rs | 10 |
4 files changed, 22 insertions, 0 deletions
diff --git a/clippy_lints/src/attrs/useless_attribute.rs b/clippy_lints/src/attrs/useless_attribute.rs index b9b5cedb5aa..1cebc18edc9 100644 --- a/clippy_lints/src/attrs/useless_attribute.rs +++ b/clippy_lints/src/attrs/useless_attribute.rs @@ -30,6 +30,7 @@ pub(super) fn check(cx: &EarlyContext<'_>, item: &Item, attrs: &[Attribute]) { sym::ambiguous_glob_reexports | sym::dead_code | sym::deprecated + | sym::deprecated_in_future | sym::hidden_glob_reexports | sym::unreachable_pub | sym::unused diff --git a/clippy_utils/src/sym.rs b/clippy_utils/src/sym.rs index 278101ac27f..e2570a15158 100644 --- a/clippy_utils/src/sym.rs +++ b/clippy_utils/src/sym.rs @@ -125,6 +125,7 @@ generate! { cycle, cyclomatic_complexity, de, + deprecated_in_future, diagnostics, disallowed_types, drain, diff --git a/tests/ui/useless_attribute.fixed b/tests/ui/useless_attribute.fixed index be4fb55ddfb..15070dd9c2c 100644 --- a/tests/ui/useless_attribute.fixed +++ b/tests/ui/useless_attribute.fixed @@ -158,3 +158,13 @@ pub mod redundant_imports_issue { empty!(); } + +pub mod issue15636 { + pub mod f { + #[deprecated(since = "TBD")] + pub mod deprec {} + } + + #[allow(deprecated_in_future)] + pub use f::deprec; +} diff --git a/tests/ui/useless_attribute.rs b/tests/ui/useless_attribute.rs index 5a1bcf97a5b..3f530de7fd8 100644 --- a/tests/ui/useless_attribute.rs +++ b/tests/ui/useless_attribute.rs @@ -158,3 +158,13 @@ pub mod redundant_imports_issue { empty!(); } + +pub mod issue15636 { + pub mod f { + #[deprecated(since = "TBD")] + pub mod deprec {} + } + + #[allow(deprecated_in_future)] + pub use f::deprec; +} |
