From 59f88d3db92cddc209b15a4edf26216f5ec9daaa Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Wed, 10 Jul 2024 01:25:57 +0300 Subject: [PATCH] Silence clippy::derived_hash_with_manual_eq for now --- compiler/rustc_type_ir/src/canonical.rs | 3 +++ compiler/rustc_type_ir/src/const_kind.rs | 3 +++ compiler/rustc_type_ir/src/predicate_kind.rs | 3 +++ compiler/rustc_type_ir/src/region_kind.rs | 3 +++ compiler/rustc_type_ir/src/ty_kind.rs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/compiler/rustc_type_ir/src/canonical.rs b/compiler/rustc_type_ir/src/canonical.rs index 4e46a3a13aa5a..f02ada152a440 100644 --- a/compiler/rustc_type_ir/src/canonical.rs +++ b/compiler/rustc_type_ir/src/canonical.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derived_hash_with_manual_eq)] + use derive_where::derive_where; #[cfg(feature = "nightly")] use rustc_macros::{HashStable_NoContext, TyDecodable, TyEncodable}; @@ -167,6 +169,7 @@ pub enum CanonicalVarKind { PlaceholderConst(I::PlaceholderConst), } +// FIXME(GrigorenkoPV): consider not implementing PartialEq manually impl PartialEq for CanonicalVarKind { fn eq(&self, other: &Self) -> bool { match (self, other) { diff --git a/compiler/rustc_type_ir/src/const_kind.rs b/compiler/rustc_type_ir/src/const_kind.rs index dab2d3bf695cf..685bb5f9a8bf5 100644 --- a/compiler/rustc_type_ir/src/const_kind.rs +++ b/compiler/rustc_type_ir/src/const_kind.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derived_hash_with_manual_eq)] + use derive_where::derive_where; #[cfg(feature = "nightly")] use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; @@ -43,6 +45,7 @@ pub enum ConstKind { Expr(I::ExprConst), } +// FIXME(GrigorenkoPV): consider not implementing PartialEq manually impl PartialEq for ConstKind { fn eq(&self, other: &Self) -> bool { match (self, other) { diff --git a/compiler/rustc_type_ir/src/predicate_kind.rs b/compiler/rustc_type_ir/src/predicate_kind.rs index 5b8b22244ba68..70b7c29bdfcc1 100644 --- a/compiler/rustc_type_ir/src/predicate_kind.rs +++ b/compiler/rustc_type_ir/src/predicate_kind.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derived_hash_with_manual_eq)] + use derive_where::derive_where; #[cfg(feature = "nightly")] use rustc_macros::{Decodable, Encodable, HashStable_NoContext, TyDecodable, TyEncodable}; @@ -38,6 +40,7 @@ pub enum ClauseKind { ConstEvaluatable(I::Const), } +// FIXME(GrigorenkoPV): consider not implementing PartialEq manually impl PartialEq for ClauseKind { fn eq(&self, other: &Self) -> bool { match (self, other) { diff --git a/compiler/rustc_type_ir/src/region_kind.rs b/compiler/rustc_type_ir/src/region_kind.rs index d56700f52eb8c..61ac83fcc98c5 100644 --- a/compiler/rustc_type_ir/src/region_kind.rs +++ b/compiler/rustc_type_ir/src/region_kind.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derived_hash_with_manual_eq)] + use derive_where::derive_where; #[cfg(feature = "nightly")] use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; @@ -193,6 +195,7 @@ const fn regionkind_discriminant(value: &RegionKind) -> usize { } } +// FIXME(GrigorenkoPV): consider not implementing PartialEq manually // This is manually implemented because a derive would require `I: PartialEq` impl PartialEq for RegionKind { #[inline] diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index 29993a50aeea0..db883511d75a5 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derived_hash_with_manual_eq)] + use derive_where::derive_where; #[cfg(feature = "nightly")] @@ -293,6 +295,7 @@ const fn tykind_discriminant(value: &TyKind) -> usize { } } +// FIXME(GrigorenkoPV): consider not implementing PartialEq manually // This is manually implemented because a derive would require `I: PartialEq` impl PartialEq for TyKind { #[inline]