Skip to content

Deprecate should_assert_eq lint #2156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

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

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

Expand Down
8 changes: 8 additions & 0 deletions clippy_lints/src/deprecated_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ macro_rules! declare_deprecated_lint {
}
}

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

/// **What it does:** Nothing. This lint has been deprecated.
///
Expand Down
7 changes: 4 additions & 3 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ pub mod regex;
pub mod returns;
pub mod serde_api;
pub mod shadow;
pub mod should_assert_eq;
pub mod strings;
pub mod explicit_write;
pub mod swap;
Expand Down Expand Up @@ -200,6 +199,10 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
};

let mut store = reg.sess.lint_store.borrow_mut();
store.register_removed(
"should_assert_eq",
"`assert!()` will be more flexible with RFC 2011"
);
store.register_removed(
"extend_from_slice",
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
Expand Down Expand Up @@ -327,7 +330,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
reg.register_early_lint_pass(box double_parens::DoubleParens);
reg.register_late_lint_pass(box unused_io_amount::UnusedIoAmount);
reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
reg.register_late_lint_pass(box should_assert_eq::ShouldAssertEq);
reg.register_late_lint_pass(box explicit_write::Pass);
reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
reg.register_early_lint_pass(box literal_digit_grouping::LiteralDigitGrouping);
Expand Down Expand Up @@ -542,7 +544,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
returns::LET_AND_RETURN,
returns::NEEDLESS_RETURN,
serde_api::SERDE_API_MISUSE,
should_assert_eq::SHOULD_ASSERT_EQ,
strings::STRING_LIT_AS_BYTES,
explicit_write::EXPLICIT_WRITE,
swap::ALMOST_SWAPPED,
Expand Down
61 changes: 0 additions & 61 deletions clippy_lints/src/should_assert_eq.rs

This file was deleted.

32 changes: 0 additions & 32 deletions tests/ui/should_assert_eq.rs

This file was deleted.

57 changes: 0 additions & 57 deletions tests/ui/should_assert_eq.stderr

This file was deleted.