-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.good first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
Description
The SpanlessEq::eq_expr
implementation has a wildcard match arm that just returns false
.
rust-clippy/clippy_utils/src/hir_utils.rs
Line 305 in d227f18
_ => false, |
This is inconsistent with SpanlessHash
, which implements hashing for each expressions type.
rust-clippy/clippy_utils/src/hir_utils.rs
Lines 785 to 789 in d227f18
ExprKind::Unary(lop, le) => { | |
std::mem::discriminant(&lop).hash(&mut self.s); | |
self.hash_expr(le); | |
}, | |
} |
PartialEq
and Hash
implementations have to be consistent. The same should apply to SpanlessEq
and SpanlessHash
Version
rustc 1.69.0-nightly (d7948c843 2023-01-26)
binary: rustc
commit-hash: d7948c843de94245c794e8c63dd4301a78bb5ba3
commit-date: 2023-01-26
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.good first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy