-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::ops::Range
does not implement std::hash::Hash
#34170
Comments
The same goes for |
Can we just derive it? |
If we'd derive it, then all type parameters would be required to implement |
Yep, but that's the behavior we'd want anyway, yes? |
Yes. Not sure how you'd hash a range with unhashable endpoints.
|
@sfackler No, if the thing that the range is variant over is not hashable, then the |
@Alexander255 I don't believe that's how |
@sflacker You're right: I was under the strong impression that |
derive Hash (and not Copy) for ranges Fixes #34170. Also, `RangeInclusive` was `Copy` by mistake -- fix that, which is a [breaking-change] to that unstable type.
@durka Thanks! |
Range
should implementHash
if the value it holds implementsHash
.Something like:
The text was updated successfully, but these errors were encountered: