Skip to content

std::ops::Range does not implement std::hash::Hash #34170

Closed
@ntninja

Description

@ntninja

Range should implement Hash if the value it holds implements Hash.

Something like:

impl<T> core::hash::Hash for core::ops::Range<T> where T: core::hash::Hash {
    fn hash<H>(&self, state: &mut H) where H: core::hash::Hasher {
        core::hash::Hash::hash(self.start, state);
        core::hash::Hash::hash(self.end, state);
    }
}

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