Skip to content

Commit

Permalink
Silence clippy::derived_hash_with_manual_eq for now
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Jul 12, 2024
1 parent 17c4e4a commit 59f88d3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/canonical.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -167,6 +169,7 @@ pub enum CanonicalVarKind<I: Interner> {
PlaceholderConst(I::PlaceholderConst),
}

// FIXME(GrigorenkoPV): consider not implementing PartialEq manually
impl<I: Interner> PartialEq for CanonicalVarKind<I> {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/const_kind.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -43,6 +45,7 @@ pub enum ConstKind<I: Interner> {
Expr(I::ExprConst),
}

// FIXME(GrigorenkoPV): consider not implementing PartialEq manually
impl<I: Interner> PartialEq for ConstKind<I> {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/predicate_kind.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -38,6 +40,7 @@ pub enum ClauseKind<I: Interner> {
ConstEvaluatable(I::Const),
}

// FIXME(GrigorenkoPV): consider not implementing PartialEq manually
impl<I: Interner> PartialEq for ClauseKind<I> {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/region_kind.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -193,6 +195,7 @@ const fn regionkind_discriminant<I: Interner>(value: &RegionKind<I>) -> usize {
}
}

// FIXME(GrigorenkoPV): consider not implementing PartialEq manually
// This is manually implemented because a derive would require `I: PartialEq`
impl<I: Interner> PartialEq for RegionKind<I> {
#[inline]
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_type_ir/src/ty_kind.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::derived_hash_with_manual_eq)]

use derive_where::derive_where;

#[cfg(feature = "nightly")]
Expand Down Expand Up @@ -293,6 +295,7 @@ const fn tykind_discriminant<I: Interner>(value: &TyKind<I>) -> usize {
}
}

// FIXME(GrigorenkoPV): consider not implementing PartialEq manually
// This is manually implemented because a derive would require `I: PartialEq`
impl<I: Interner> PartialEq for TyKind<I> {
#[inline]
Expand Down

0 comments on commit 59f88d3

Please sign in to comment.