diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-09-13 18:20:27 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-09-18 11:27:10 +0200 |
| commit | 67c84e05e72931587e5f81a297dee95bc149bcd8 (patch) | |
| tree | 218a7eb69f31e03b0c019549c5d5392a1310bd9d /src/librustc/traits | |
| parent | b9816c5fab6bfde01f83d83a0b53e78bb00d3900 (diff) | |
| download | rust-67c84e05e72931587e5f81a297dee95bc149bcd8.tar.gz rust-67c84e05e72931587e5f81a297dee95bc149bcd8.zip | |
incr.comp.: Use StableHash impls instead of functions for hashing most maps.
Diffstat (limited to 'src/librustc/traits')
| -rw-r--r-- | src/librustc/traits/specialize/specialization_graph.rs | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/librustc/traits/specialize/specialization_graph.rs b/src/librustc/traits/specialize/specialization_graph.rs index ecaf14659ae..6895e0e8a34 100644 --- a/src/librustc/traits/specialize/specialization_graph.rs +++ b/src/librustc/traits/specialize/specialization_graph.rs @@ -382,20 +382,7 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for Childr } } -impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for Graph { - fn hash_stable<W: StableHasherResult>(&self, - hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, - hasher: &mut StableHasher<W>) { - let Graph { - ref parent, - ref children, - } = *self; - - ich::hash_stable_hashmap(hcx, hasher, parent, |hcx, def_id| { - hcx.def_path_hash(*def_id) - }); - ich::hash_stable_hashmap(hcx, hasher, children, |hcx, def_id| { - hcx.def_path_hash(*def_id) - }); - } -} +impl_stable_hash_for!(struct self::Graph { + parent, + children +}); |
