Skip to content

Commit dceb81a

Browse files
committed
Deprecate clippy lint
1 parent cd159fd commit dceb81a

File tree

9 files changed

+21
-111
lines changed

9 files changed

+21
-111
lines changed

src/tools/clippy/clippy_lints/src/deprecated_lints.rs

+9
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,12 @@ declare_deprecated_lint! {
163163
pub REGEX_MACRO,
164164
"the regex! macro has been removed from the regex crate in 2018"
165165
}
166+
167+
declare_deprecated_lint! {
168+
/// **What it does:** Nothing. This lint has been deprecated.
169+
///
170+
/// **Deprecation reason:** This lint has been uplifted to rustc and is now called
171+
/// `drop_bounds`.
172+
pub DROP_BOUNDS,
173+
"this lint has been uplifted to rustc and is now called `drop_bounds`"
174+
}

src/tools/clippy/clippy_lints/src/drop_bounds.rs

-73
This file was deleted.

src/tools/clippy/clippy_lints/src/lib.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ mod derive;
179179
mod doc;
180180
mod double_comparison;
181181
mod double_parens;
182-
mod drop_bounds;
183182
mod drop_forget_ref;
184183
mod duration_subsec;
185184
mod else_if_without_else;
@@ -478,6 +477,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
478477
"clippy::regex_macro",
479478
"the regex! macro has been removed from the regex crate in 2018",
480479
);
480+
store.register_removed(
481+
"clippy::drop_bounds",
482+
"this lint has been uplifted to rustc and is now called `drop_bounds`",
483+
);
481484
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
482485

483486
// begin register lints, do not remove this comment, it’s used in `update_lints`
@@ -532,7 +535,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
532535
&doc::NEEDLESS_DOCTEST_MAIN,
533536
&double_comparison::DOUBLE_COMPARISONS,
534537
&double_parens::DOUBLE_PARENS,
535-
&drop_bounds::DROP_BOUNDS,
536538
&drop_forget_ref::DROP_COPY,
537539
&drop_forget_ref::DROP_REF,
538540
&drop_forget_ref::FORGET_COPY,
@@ -959,7 +961,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
959961
store.register_late_pass(|| box strings::StringLitAsBytes);
960962
store.register_late_pass(|| box derive::Derive);
961963
store.register_late_pass(|| box types::CharLitAsU8);
962-
store.register_late_pass(|| box drop_bounds::DropBounds);
963964
store.register_late_pass(|| box get_last_with_len::GetLastWithLen);
964965
store.register_late_pass(|| box drop_forget_ref::DropForgetRef);
965966
store.register_late_pass(|| box empty_enum::EmptyEnum);
@@ -1282,7 +1283,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12821283
LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
12831284
LintId::of(&double_comparison::DOUBLE_COMPARISONS),
12841285
LintId::of(&double_parens::DOUBLE_PARENS),
1285-
LintId::of(&drop_bounds::DROP_BOUNDS),
12861286
LintId::of(&drop_forget_ref::DROP_COPY),
12871287
LintId::of(&drop_forget_ref::DROP_REF),
12881288
LintId::of(&drop_forget_ref::FORGET_COPY),
@@ -1714,7 +1714,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17141714
LintId::of(&copies::IF_SAME_THEN_ELSE),
17151715
LintId::of(&derive::DERIVE_HASH_XOR_EQ),
17161716
LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
1717-
LintId::of(&drop_bounds::DROP_BOUNDS),
17181717
LintId::of(&drop_forget_ref::DROP_COPY),
17191718
LintId::of(&drop_forget_ref::DROP_REF),
17201719
LintId::of(&drop_forget_ref::FORGET_COPY),

src/tools/clippy/clippy_lints/src/utils/paths.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub const DISPLAY_FMT_METHOD: [&str; 4] = ["core", "fmt", "Display", "fmt"];
3131
pub const DISPLAY_TRAIT: [&str; 3] = ["core", "fmt", "Display"];
3232
pub const DOUBLE_ENDED_ITERATOR: [&str; 4] = ["core", "iter", "traits", "DoubleEndedIterator"];
3333
pub const DROP: [&str; 3] = ["core", "mem", "drop"];
34-
pub const DROP_TRAIT: [&str; 4] = ["core", "ops", "drop", "Drop"];
3534
pub const DURATION: [&str; 3] = ["core", "time", "Duration"];
3635
pub const EARLY_CONTEXT: [&str; 4] = ["rustc", "lint", "context", "EarlyContext"];
3736
pub const EXIT: [&str; 3] = ["std", "process", "exit"];

src/tools/clippy/src/lintlist/mod.rs

-7
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,6 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
423423
deprecation: None,
424424
module: "double_parens",
425425
},
426-
Lint {
427-
name: "drop_bounds",
428-
group: "correctness",
429-
desc: "bounds of the form `T: Drop` are useless",
430-
deprecation: None,
431-
module: "drop_bounds",
432-
},
433426
Lint {
434427
name: "drop_copy",
435428
group: "correctness",

src/tools/clippy/tests/ui/deprecated.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
#[warn(clippy::into_iter_on_array)]
99
#[warn(clippy::unused_label)]
1010
#[warn(clippy::regex_macro)]
11+
#[warn(clippy::drop_bounds)]
1112

1213
fn main() {}

src/tools/clippy/tests/ui/deprecated.stderr

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,17 @@ error: lint `clippy::regex_macro` has been removed: `the regex! macro has been r
6060
LL | #[warn(clippy::regex_macro)]
6161
| ^^^^^^^^^^^^^^^^^^^
6262

63+
error: lint `clippy::drop_bounds` has been removed: `this lint has been uplifted to rustc and is now called `drop_bounds``
64+
--> $DIR/deprecated.rs:11:8
65+
|
66+
LL | #[warn(clippy::drop_bounds)]
67+
| ^^^^^^^^^^^^^^^^^^^
68+
6369
error: lint `clippy::str_to_string` has been removed: `using `str::to_string` is common even today and specialization will likely happen soon`
6470
--> $DIR/deprecated.rs:1:8
6571
|
6672
LL | #[warn(clippy::str_to_string)]
6773
| ^^^^^^^^^^^^^^^^^^^^^
6874

69-
error: aborting due to 11 previous errors
75+
error: aborting due to 12 previous errors
7076

src/tools/clippy/tests/ui/drop_bounds.rs

-8
This file was deleted.

src/tools/clippy/tests/ui/drop_bounds.stderr

-16
This file was deleted.

0 commit comments

Comments
 (0)