@@ -19,6 +19,7 @@ use rustc_data_structures::sync::Lrc;
19
19
use rustc_macros:: HashStable_Generic ;
20
20
21
21
#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Hash , Debug , Copy ) ]
22
+ #[ derive( HashStable_Generic ) ]
22
23
pub enum BinOpToken {
23
24
Plus ,
24
25
Minus ,
@@ -192,7 +193,7 @@ fn ident_can_begin_type(name: ast::Name, span: Span, is_raw: bool) -> bool {
192
193
] . contains ( & name)
193
194
}
194
195
195
- #[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug ) ]
196
+ #[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
196
197
pub enum TokenKind {
197
198
/* Expression-operator symbols. */
198
199
Eq ,
@@ -264,14 +265,6 @@ pub enum TokenKind {
264
265
#[ cfg( target_arch = "x86_64" ) ]
265
266
rustc_data_structures:: static_assert_size!( TokenKind , 16 ) ;
266
267
267
- impl < CTX > HashStable < CTX > for TokenKind
268
- where CTX : crate :: HashStableContext
269
- {
270
- fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
271
- hcx. hash_stable_tokenkind ( self , hasher)
272
- }
273
- }
274
-
275
268
#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
276
269
pub struct Token {
277
270
pub kind : TokenKind ,
@@ -735,3 +728,11 @@ impl fmt::Debug for Nonterminal {
735
728
}
736
729
}
737
730
}
731
+
732
+ impl < CTX > HashStable < CTX > for Nonterminal
733
+ where CTX : crate :: HashStableContext
734
+ {
735
+ fn hash_stable ( & self , _hcx : & mut CTX , _hasher : & mut StableHasher ) {
736
+ panic ! ( "interpolated tokens should not be present in the HIR" )
737
+ }
738
+ }
0 commit comments