-
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
impl Hasher for {&mut Hasher, Box<Hasher>} #44015
Conversation
Just a head's up, probably not a big deal. New blanket impls for &T, &mut T, Box<T> are technically breaking for an existing trait. If both Foo and Box<Foo> implemented Hasher, that crate would now break. It's the effect of allowing the user's box implementation in the first place (the “fundamental rule”). |
@bluss Oops, so crater is needed? The impl can be change to only applying on the trait objects |
cc @aidanhs mind running cargobomb for this? |
@bors try |
impl Hasher for {&mut Hasher, Box<Hasher>} **Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution. **Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
☀️ Test successful - status-travis |
Cargobomb run started |
Cargobomb results: http://cargobomb-reports.s3.amazonaws.com/pr-44015/index.html Blacklist (spurious failures etc) at https://github.com/rust-lang-nursery/cargobomb/blob/master/blacklist.md. If you see any spurious failures not on the list, please make a PR against that file. |
14 regressions. All spurious.
Note (a): The |
@arielb1 Could you please change the tag back to |
@bors: r+ Sorry for the delay but looks great! |
📌 Commit 4f454db has been approved by |
⌛ Testing commit 4f454db9713c189405db8f3022ece88050e883ff with merge d14f2577ad399156609192de8d81c619fd48f54a... |
💔 Test failed - status-travis |
I'll check why this happens later.
|
e055eba
to
4d9ec08
Compare
8636ac2
to
70ecf4b
Compare
@alexcrichton Fixed by disabling the tests on Emscripten. Same issue as emscripten-core/emscripten-fastcomp#169. cc #35118. |
@bors: r+ |
📌 Commit 143e2dc has been approved by |
⌛ Testing commit 143e2dc with merge 011a41ff767b697e8b53ea5956e78108fd3a00de... |
💔 Test failed - status-travis |
|
impl Hasher for {&mut Hasher, Box<Hasher>} **Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution. **Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
☀️ Test successful - status-appveyor, status-travis |
Rationale: The
Hash
trait hasfn hash<H: Hasher>(&self, state: &mut H)
, which can only accept aSized
hasher, even if theHasher
trait is object-safe. We cannot retroactively add the?Sized
bound without breaking stability, thus implementingHasher
to a trait object reference is the next best solution.Warning: These
impl
are insta-stable, and should need an FCP. I don't think a full RFC is necessary.