This commit is contained in:
Robert Bastian 2023-01-10 11:12:54 +01:00
parent 53c12e085a
commit 8ca900b01c
7 changed files with 9 additions and 5 deletions

View file

@ -4137,6 +4137,7 @@ Released 2018-09-13
[`derive_hash_xor_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_hash_xor_eq [`derive_hash_xor_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_hash_xor_eq
[`derive_ord_xor_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord [`derive_ord_xor_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord
[`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq [`derive_partial_eq_without_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
[`derived_hash_with_manual_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derived_hash_with_manual_eq
[`disallowed_macros`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros [`disallowed_macros`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method [`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
[`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods [`disallowed_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods

View file

@ -111,7 +111,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
crate::dereference::NEEDLESS_BORROW_INFO, crate::dereference::NEEDLESS_BORROW_INFO,
crate::dereference::REF_BINDING_TO_REFERENCE_INFO, crate::dereference::REF_BINDING_TO_REFERENCE_INFO,
crate::derivable_impls::DERIVABLE_IMPLS_INFO, crate::derivable_impls::DERIVABLE_IMPLS_INFO,
crate::derive::DERIVE_HASH_XOR_EQ_INFO, crate::derive::DERIVED_HASH_WITH_MANUAL_EQ_INFO,
crate::derive::DERIVE_ORD_XOR_PARTIAL_ORD_INFO, crate::derive::DERIVE_ORD_XOR_PARTIAL_ORD_INFO,
crate::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ_INFO, crate::derive::DERIVE_PARTIAL_EQ_WITHOUT_EQ_INFO,
crate::derive::EXPL_IMPL_CLONE_ON_COPY_INFO, crate::derive::EXPL_IMPL_CLONE_ON_COPY_INFO,

View file

@ -46,7 +46,7 @@ declare_clippy_lint! {
/// } /// }
/// ``` /// ```
#[clippy::version = "pre 1.29.0"] #[clippy::version = "pre 1.29.0"]
pub DERIVE_HASH_XOR_EQ, pub DERIVED_HASH_WITH_MANUAL_EQ,
correctness, correctness,
"deriving `Hash` but implementing `PartialEq` explicitly" "deriving `Hash` but implementing `PartialEq` explicitly"
} }
@ -197,7 +197,7 @@ declare_clippy_lint! {
declare_lint_pass!(Derive => [ declare_lint_pass!(Derive => [
EXPL_IMPL_CLONE_ON_COPY, EXPL_IMPL_CLONE_ON_COPY,
DERIVE_HASH_XOR_EQ, DERIVED_HASH_WITH_MANUAL_EQ,
DERIVE_ORD_XOR_PARTIAL_ORD, DERIVE_ORD_XOR_PARTIAL_ORD,
UNSAFE_DERIVE_DESERIALIZE, UNSAFE_DERIVE_DESERIALIZE,
DERIVE_PARTIAL_EQ_WITHOUT_EQ DERIVE_PARTIAL_EQ_WITHOUT_EQ
@ -226,7 +226,7 @@ impl<'tcx> LateLintPass<'tcx> for Derive {
} }
} }
/// Implementation of the `DERIVE_HASH_XOR_EQ` lint. /// Implementation of the `DERIVED_HASH_WITH_MANUAL_EQ` lint.
fn check_hash_peq<'tcx>( fn check_hash_peq<'tcx>(
cx: &LateContext<'tcx>, cx: &LateContext<'tcx>,
span: Span, span: Span,
@ -254,7 +254,7 @@ fn check_hash_peq<'tcx>(
if trait_ref.substs.type_at(1) == ty { if trait_ref.substs.type_at(1) == ty {
span_lint_and_then( span_lint_and_then(
cx, cx,
DERIVE_HASH_XOR_EQ, DERIVED_HASH_WITH_MANUAL_EQ,
span, span,
"you are deriving `Hash` but have implemented `PartialEq` explicitly", "you are deriving `Hash` but have implemented `PartialEq` explicitly",
|diag| { |diag| {

View file

@ -9,6 +9,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
("clippy::box_vec", "clippy::box_collection"), ("clippy::box_vec", "clippy::box_collection"),
("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"), ("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes"),
("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"), ("clippy::cyclomatic_complexity", "clippy::cognitive_complexity"),
("clippy::derive_hash_xor_eq", "clippy::derived_hash_with_manual_eq"),
("clippy::disallowed_method", "clippy::disallowed_methods"), ("clippy::disallowed_method", "clippy::disallowed_methods"),
("clippy::disallowed_type", "clippy::disallowed_types"), ("clippy::disallowed_type", "clippy::disallowed_types"),
("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"), ("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"),

View file

@ -10,6 +10,7 @@
#![allow(clippy::box_collection)] #![allow(clippy::box_collection)]
#![allow(clippy::redundant_static_lifetimes)] #![allow(clippy::redundant_static_lifetimes)]
#![allow(clippy::cognitive_complexity)] #![allow(clippy::cognitive_complexity)]
#![allow(clippy::derived_hash_with_manual_eq)]
#![allow(clippy::disallowed_methods)] #![allow(clippy::disallowed_methods)]
#![allow(clippy::disallowed_types)] #![allow(clippy::disallowed_types)]
#![allow(clippy::mixed_read_write_in_expression)] #![allow(clippy::mixed_read_write_in_expression)]
@ -45,6 +46,7 @@
#![warn(clippy::box_vec)] #![warn(clippy::box_vec)]
#![warn(clippy::const_static_lifetime)] #![warn(clippy::const_static_lifetime)]
#![warn(clippy::cyclomatic_complexity)] #![warn(clippy::cyclomatic_complexity)]
#![warn(clippy::derive_hash_xor_eq)]
#![warn(clippy::disallowed_method)] #![warn(clippy::disallowed_method)]
#![warn(clippy::disallowed_type)] #![warn(clippy::disallowed_type)]
#![warn(clippy::eval_order_dependence)] #![warn(clippy::eval_order_dependence)]