Skip to content

Commit 7e7ce10

Browse files
committed
fix: useless_attribute FP on deprecated_in_future
1 parent 368b235 commit 7e7ce10

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

clippy_lints/src/attrs/useless_attribute.rs

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

clippy_utils/src/sym.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ generate! {
125125
cycle,
126126
cyclomatic_complexity,
127127
de,
128+
deprecated_in_future,
128129
diagnostics,
129130
disallowed_types,
130131
drain,

tests/ui/useless_attribute.fixed

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,13 @@ pub mod redundant_imports_issue {
158158

159159
empty!();
160160
}
161+
162+
pub mod issue15636 {
163+
pub mod f {
164+
#[deprecated(since = "TBD")]
165+
pub mod deprec {}
166+
}
167+
168+
#[allow(deprecated_in_future)]
169+
pub use f::deprec;
170+
}

tests/ui/useless_attribute.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,13 @@ pub mod redundant_imports_issue {
158158

159159
empty!();
160160
}
161+
162+
pub mod issue15636 {
163+
pub mod f {
164+
#[deprecated(since = "TBD")]
165+
pub mod deprec {}
166+
}
167+
168+
#[allow(deprecated_in_future)]
169+
pub use f::deprec;
170+
}

0 commit comments

Comments
 (0)