]> git.lizzy.rs Git - rust.git/commitdiff
Panic when hashing node IDs
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 15 Feb 2020 17:07:17 +0000 (18:07 +0100)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 15 Feb 2020 17:07:17 +0000 (18:07 +0100)
src/librustc/ich/hcx.rs
src/libsyntax/node_id.rs

index e0e8470fe4730f7b240802d50bedf2891959e724..9e2db35dc6db8f5395b2e610759a3779a3cee118 100644 (file)
@@ -219,12 +219,9 @@ fn to_stable_hash_key(
     }
 }
 
-impl<'a> ToStableHashKey<StableHashingContext<'a>> for ast::NodeId {
-    type KeyType = Self;
-
-    #[inline]
-    fn to_stable_hash_key(&self, _: &StableHashingContext<'a>) -> Self {
-        *self
+impl<'a> HashStable<StableHashingContext<'a>> for ast::NodeId {
+    fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) {
+        panic!("Node IDs should not appear in incremental state");
     }
 }
 
index 430d8f30421ef2bb8128873878a3b374c45b9658..58d2334a7b148ccf150bd0acb04d04489b582710 100644 (file)
@@ -1,10 +1,8 @@
-use rustc_macros::HashStable_Generic;
 use rustc_serialize::{Decoder, Encoder};
 use rustc_span::ExpnId;
 use std::fmt;
 
 rustc_index::newtype_index! {
-    #[derive(HashStable_Generic)]
     pub struct NodeId {
         ENCODABLE = custom
         DEBUG_FORMAT = "NodeId({})"