Skip to content

Commit 2a67986

Browse files
committed
HashStable literals in libsyntax.
1 parent efcb695 commit 2a67986

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/librustc/ich/impls_syntax.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,6 @@ for tokenstream::TokenStream {
137137
}
138138
}
139139

140-
impl_stable_hash_for!(enum token::LitKind {
141-
Bool,
142-
Byte,
143-
Char,
144-
Integer,
145-
Float,
146-
Str,
147-
ByteStr,
148-
StrRaw(n),
149-
ByteStrRaw(n),
150-
Err
151-
});
152-
153-
impl_stable_hash_for!(struct token::Lit {
154-
kind,
155-
symbol,
156-
suffix
157-
});
158-
159140
impl<'a> HashStable<StableHashingContext<'a>> for token::TokenKind {
160141
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
161142
mem::discriminant(self).hash_stable(hcx, hasher);

src/libsyntax/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl DelimToken {
5353
}
5454
}
5555

56-
#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
56+
#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
5757
pub enum LitKind {
5858
Bool, // AST only, must never appear in a `Token`
5959
Byte,
@@ -68,7 +68,7 @@ pub enum LitKind {
6868
}
6969

7070
/// A literal token.
71-
#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
71+
#[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
7272
pub struct Lit {
7373
pub kind: LitKind,
7474
pub symbol: Symbol,

0 commit comments

Comments
 (0)