]> git.lizzy.rs Git - rust.git/commitdiff
HashStable literals in libsyntax.
authorCamille GILLOT <gillot.camille@gmail.com>
Sat, 9 Nov 2019 21:02:24 +0000 (22:02 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Sun, 17 Nov 2019 21:37:10 +0000 (22:37 +0100)
src/librustc/ich/impls_syntax.rs
src/libsyntax/token.rs

index bf716dbf0619aed1672004709cd81bc9a84017aa..d86fd0f1dc362603b990628779dc53fae2c3b5b3 100644 (file)
@@ -137,25 +137,6 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
     }
 }
 
-impl_stable_hash_for!(enum token::LitKind {
-    Bool,
-    Byte,
-    Char,
-    Integer,
-    Float,
-    Str,
-    ByteStr,
-    StrRaw(n),
-    ByteStrRaw(n),
-    Err
-});
-
-impl_stable_hash_for!(struct token::Lit {
-    kind,
-    symbol,
-    suffix
-});
-
 impl<'a> HashStable<StableHashingContext<'a>> for token::TokenKind {
     fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
         mem::discriminant(self).hash_stable(hcx, hasher);
index ab798e93d67fc009bb2208b86c5d400f44e9ae76..8099b55780cb4d130fa7ed285f01b52109a2eb59 100644 (file)
@@ -53,7 +53,7 @@ pub fn is_empty(self) -> bool {
     }
 }
 
-#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
+#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
 pub enum LitKind {
     Bool, // AST only, must never appear in a `Token`
     Byte,
@@ -68,7 +68,7 @@ pub enum LitKind {
 }
 
 /// A literal token.
-#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
+#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
 pub struct Lit {
     pub kind: LitKind,
     pub symbol: Symbol,