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. Details |
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 |
|
Details |
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
Hashtrait hasfn hash<H: Hasher>(&self, state: &mut H), which can only accept aSizedhasher, even if theHashertrait is object-safe. We cannot retroactively add the?Sizedbound without breaking stability, thus implementingHasherto a trait object reference is the next best solution.Warning: These
implare insta-stable, and should need an FCP. I don't think a full RFC is necessary.