-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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::slice::SliceConcatExt impls should rely on AsRef rather than Borrow #26780
Comments
A couple RFCs related to SliceConcatExt (for the sake of crosslinking): |
See discussion on #25162 why it was changed to Borrow |
Yes, @aturon @alexcrichton , is this actually intended? Seems so |
/cc @rust-lang/libs |
To be clear: Almost the entire reason for Borrow to exist is to have "AsRef where Hash/Eq/Ord are expected to hold". (the rest of the reason is differing blanket impls in a world without specialization) (not clear on what @SimonSapin meant with "may not be desirable") |
Yes this was switched to |
In string-cache we have: #[derive(PartialEq, Eq, Hash)]
struct Atom { magic: u64 }
impl Deref for Atom { Target = str; ... } The whole point of this library is to make To make make
|
HashMap
assumes thatBorrow
implies compatible hashing, which may not be desirable: servo/string-cache#89The text was updated successfully, but these errors were encountered: