Skip to content

Implement Hash for HashSet #21182

Closed
Closed
@mdinger

Description

@mdinger

This doesn't work but should be possible somehow. @chris-morgan @huonw @Aatch and others found a method to implement one: IRC log. Exact solution link here

use std::collections::HashSet;

#[derive(Hash, Eq, PartialEq)]
enum Enum {
    A,
    B(HashSet<Enum>),
}

fn main(){
    let mut set = HashSet::new();

    set.insert(Enum::A);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions