Skip to content

Commit 9293188

Browse files
authored
Merge pull request #2156 from cgm616/master
Deprecate should_assert_eq lint
2 parents 281bd79 + 4960d9d commit 9293188

File tree

6 files changed

+13
-154
lines changed

6 files changed

+13
-154
lines changed

README.md

+1-1
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

+8
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

+4-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ pub mod regex;
145145
pub mod returns;
146146
pub mod serde_api;
147147
pub mod shadow;
148-
pub mod should_assert_eq;
149148
pub mod strings;
150149
pub mod swap;
151150
pub mod temporary_assignment;
@@ -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);
@@ -546,7 +548,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
546548
returns::LET_AND_RETURN,
547549
returns::NEEDLESS_RETURN,
548550
serde_api::SERDE_API_MISUSE,
549-
should_assert_eq::SHOULD_ASSERT_EQ,
550551
strings::STRING_LIT_AS_BYTES,
551552
swap::ALMOST_SWAPPED,
552553
swap::MANUAL_SWAP,

clippy_lints/src/should_assert_eq.rs

-61
This file was deleted.

tests/ui/should_assert_eq.rs

-32
This file was deleted.

tests/ui/should_assert_eq.stderr

-57
This file was deleted.

0 commit comments

Comments
 (0)