Skip to content

Commit 4960d9d

Browse files
committed
Deprecate should_assert_eq lint
This should close #2090.
1 parent f47e564 commit 4960d9d

File tree

6 files changed

+13
-154
lines changed

6 files changed

+13
-154
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
99

10-
[There are 209 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
10+
[There are 208 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
1111

1212
More to come, please [file an issue](https://github.com/rust-lang-nursery/rust-clippy/issues) if you have ideas!
1313

clippy_lints/src/deprecated_lints.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ macro_rules! declare_deprecated_lint {
44
}
55
}
66

7+
/// **What it does:** Nothing. This lint has been deprecated.
8+
///
9+
/// **Deprecation reason:** This used to check for `assert!(a == b)` and recommend
10+
/// replacement with `assert_eq!(a, b)`, but this is no longer needed after RFC 2011.
11+
declare_deprecated_lint! {
12+
pub SHOULD_ASSERT_EQ,
13+
"`assert!()` will be more flexible with RFC 2011"
14+
}
715

816
/// **What it does:** Nothing. This lint has been deprecated.
917
///

clippy_lints/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ pub mod regex;
144144
pub mod returns;
145145
pub mod serde_api;
146146
pub mod shadow;
147-
pub mod should_assert_eq;
148147
pub mod strings;
149148
pub mod explicit_write;
150149
pub mod swap;
@@ -200,6 +199,10 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
200199
};
201200

202201
let mut store = reg.sess.lint_store.borrow_mut();
202+
store.register_removed(
203+
"should_assert_eq",
204+
"`assert!()` will be more flexible with RFC 2011"
205+
);
203206
store.register_removed(
204207
"extend_from_slice",
205208
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
@@ -327,7 +330,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
327330
reg.register_early_lint_pass(box double_parens::DoubleParens);
328331
reg.register_late_lint_pass(box unused_io_amount::UnusedIoAmount);
329332
reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
330-
reg.register_late_lint_pass(box should_assert_eq::ShouldAssertEq);
331333
reg.register_late_lint_pass(box explicit_write::Pass);
332334
reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
333335
reg.register_early_lint_pass(box literal_digit_grouping::LiteralDigitGrouping);
@@ -542,7 +544,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
542544
returns::LET_AND_RETURN,
543545
returns::NEEDLESS_RETURN,
544546
serde_api::SERDE_API_MISUSE,
545-
should_assert_eq::SHOULD_ASSERT_EQ,
546547
strings::STRING_LIT_AS_BYTES,
547548
explicit_write::EXPLICIT_WRITE,
548549
swap::ALMOST_SWAPPED,

clippy_lints/src/should_assert_eq.rs

Lines changed: 0 additions & 61 deletions
This file was deleted.

tests/ui/should_assert_eq.rs

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/ui/should_assert_eq.stderr

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)