Skip to content

Make SpanlessEq more consistent #10267

Closed
Closed
@flip1995

Description

@flip1995

Description

The SpanlessEq::eq_expr implementation has a wildcard match arm that just returns false.

This is inconsistent with SpanlessHash, which implements hashing for each expressions type.

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.good first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions