HashStable literals in libsyntax.
This commit is contained in:
parent
efcb695f4c
commit
2a67986eb6
2 changed files with 2 additions and 21 deletions
|
|
@ -137,25 +137,6 @@ for tokenstream::TokenStream {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ impl DelimToken {
|
|||
}
|
||||
}
|
||||
|
||||
#[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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue