Skip to content

HashSet operations against another HashSet should allow for differing hash algorithms #31712

Open
@shepmaster

Description

@shepmaster

Operations such as intersection take a second HashMap. It's required that the second HashMap implement the same hashing algorithm as the first one:

impl<T, S> HashSet<T, S>
    where T: Eq + Hash,
          S: HashState
{
    fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S>;
}

This means that you cannot intersect a HashMap<u8, SipHash> against a HashMap<u8, FnvHash>. This seems overly restrictive.

/cc @bluss

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions