From 003b1699c0044aef757c9c32df13a529fd4c485b Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Tue, 15 Nov 2016 11:55:34 -0500 Subject: [PATCH] Add error message when not finding the ICH of a DepNode. --- src/librustc_incremental/calculate_svh/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_incremental/calculate_svh/mod.rs b/src/librustc_incremental/calculate_svh/mod.rs index c08519090d2..0339f488272 100644 --- a/src/librustc_incremental/calculate_svh/mod.rs +++ b/src/librustc_incremental/calculate_svh/mod.rs @@ -88,7 +88,12 @@ impl<'a> ::std::ops::Index<&'a DepNode> for IncrementalHashesMap { type Output = Fingerprint; fn index(&self, index: &'a DepNode) -> &Fingerprint { - &self.hashes[index] + match self.hashes.get(index) { + Some(fingerprint) => fingerprint, + None => { + bug!("Could not find ICH for {:?}", index); + } + } } }