diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-29 04:36:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-29 04:36:02 +0200 |
| commit | d7d7c2fce28f0fe39eec129fc29b0e78f3fb2317 (patch) | |
| tree | 90da203e88601999c1dc1e4b5852774f02e51fbd /src/librustc_codegen_ssa | |
| parent | b30d9beafbedb898253a3103ff6afd9f034149f4 (diff) | |
| parent | 14a5aefb01bb4f18749ab56cd9fd37bf93c86a37 (diff) | |
Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, r=michaelwoerister
No StableHasherResult everywhere
This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping.
This is done for two reasons:
* we should avoid false "generic" dependency on the result of StableHasher
* we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too.
* Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/common.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/librustc_codegen_ssa/common.rs b/src/librustc_codegen_ssa/common.rs index 6376512ca40..e3aa35ef4eb 100644 --- a/src/librustc_codegen_ssa/common.rs +++ b/src/librustc_codegen_ssa/common.rs @@ -109,14 +109,11 @@ pub enum TypeKind { // for now we content ourselves with providing a no-op HashStable // implementation for CGUs. mod temp_stable_hash_impls { - use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher, - HashStable}; + use rustc_data_structures::stable_hasher::{StableHasher, HashStable}; use crate::ModuleCodegen; impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> { - fn hash_stable<W: StableHasherResult>(&self, - _: &mut HCX, - _: &mut StableHasher<W>) { + fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) { // do nothing } } |
