servo: Merge #18829 - Verify in DiagnosticHashMap::drop (from bholley:verify_in_drop); r=Manishearth
authorBobby Holley <bobbyholley@gmail.com>
Wed, 11 Oct 2017 13:53:01 -0500
changeset 679135 28a041a33fece4b42d3984cca4698334d656c99e
parent 679134 5fa05ab4204d94707e8f72ce8514d05588345daf
child 679136 462c85ecfe5b684a34b1b133995dc5d2e97ae10e
push id84141
push userbmo:schien@mozilla.com
push dateThu, 12 Oct 2017 11:13:04 +0000
reviewersManishearth
milestone58.0a1
servo: Merge #18829 - Verify in DiagnosticHashMap::drop (from bholley:verify_in_drop); r=Manishearth This will let us reason better about the drop_in_place crashes. Source-Repo: https://github.com/servo/servo Source-Revision: 882b22b6068826f49e8279910784db8b3ebb61f0
servo/components/hashglobe/src/diagnostic.rs
--- a/servo/components/hashglobe/src/diagnostic.rs
+++ b/servo/components/hashglobe/src/diagnostic.rs
@@ -204,16 +204,18 @@ impl<K, V, S> Default for DiagnosticHash
     }
 }
 
 impl<K: Hash + Eq, V, S: BuildHasher> Drop for DiagnosticHashMap<K, V, S>
     where K: Eq + Hash,
           S: BuildHasher
 {
     fn drop(&mut self) {
+        self.map.verify();
         debug_assert!(self.readonly, "Dropped while mutating");
+        self.verify();
     }
 }
 
 extern "C" {
     pub fn Gecko_AnnotateCrashReport(key_str: *const ::std::os::raw::c_char,
                                      value_str: *const ::std::os::raw::c_char);
 }