about summary refs log tree commit diff
path: root/src/librustc_data_structures/stable_hasher.rs
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2017-04-05 23:39:02 +0200
committerMichael Woerister <michaelwoerister@posteo.net>2017-04-12 11:47:26 +0200
commitca2dce9b48e65ae2b286fbd10e459536ecccb2d8 (patch)
tree7c9fe9ae6a318e6c5a3a8a66ffa6829938d3c412 /src/librustc_data_structures/stable_hasher.rs
parentbc7af816f3b8712efa4e6643f9cdeb1d5ba5c78a (diff)
downloadrust-ca2dce9b48e65ae2b286fbd10e459536ecccb2d8.tar.gz
rust-ca2dce9b48e65ae2b286fbd10e459536ecccb2d8.zip
ICH: Replace old, transitive metadata hashing with direct hashing approach.
Instead of collecting all potential inputs to some metadata entry and
hashing those, we directly hash the values we are storing in metadata.
This is more accurate and doesn't suffer from quadratic blow-up when
many entries have the same dependencies.
Diffstat (limited to 'src/librustc_data_structures/stable_hasher.rs')
-rw-r--r--src/librustc_data_structures/stable_hasher.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_data_structures/stable_hasher.rs b/src/librustc_data_structures/stable_hasher.rs
index dc412a0763e..95f063976d4 100644
--- a/src/librustc_data_structures/stable_hasher.rs
+++ b/src/librustc_data_structures/stable_hasher.rs
@@ -40,13 +40,18 @@ fn write_signed_leb128_to_buf(buf: &mut [u8; 16], value: i64) -> usize {
 /// This hasher currently always uses the stable Blake2b algorithm
 /// and allows for variable output lengths through its type
 /// parameter.
-#[derive(Debug)]
 pub struct StableHasher<W> {
     state: Blake2bHasher,
     bytes_hashed: u64,
     width: PhantomData<W>,
 }
 
+impl<W: StableHasherResult> ::std::fmt::Debug for StableHasher<W> {
+    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+        write!(f, "{:?}", self.state)
+    }
+}
+
 pub trait StableHasherResult: Sized {
     fn finish(hasher: StableHasher<Self>) -> Self;
 }