Skip to content

non-derived hash and partialeq impls #2

Open
@gilescope

Description

@gilescope

I got thinking based on this clippy lint https://rust-lang.github.io/rust-clippy/master/#derive_hash_xor_eq about whether formal methods might be able to have a tool that checks that the hash implementations and the equality implementations meet a hashmap's requirements.

This is a common and insidious problem in computing, and while proving all implementations is probably not possible, I have a hunch that we can automatically prove that the vast majority of these implementations do maintain the required invariants because it's a very constrained problem.

Is there prior art on trying to tackle this problem? I could see this adding a lot of value if we could solve this problem. At the moment when we impl PartialEq and Hash we're saying trust the programmer, but it would be cool to verify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions