@@ -19,6 +19,7 @@ use rustc_data_structures::sync::Lrc;
1919use rustc_macros:: HashStable_Generic ;
2020
2121#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Hash , Debug , Copy ) ]
22+ #[ derive( HashStable_Generic ) ]
2223pub enum BinOpToken {
2324 Plus ,
2425 Minus ,
@@ -192,7 +193,7 @@ fn ident_can_begin_type(name: ast::Name, span: Span, is_raw: bool) -> bool {
192193 ] . contains ( & name)
193194}
194195
195- #[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug ) ]
196+ #[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
196197pub enum TokenKind {
197198 /* Expression-operator symbols. */
198199 Eq ,
@@ -264,14 +265,6 @@ pub enum TokenKind {
264265#[ cfg( target_arch = "x86_64" ) ]
265266rustc_data_structures:: static_assert_size!( TokenKind , 16 ) ;
266267
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-
275268#[ derive( Clone , PartialEq , RustcEncodable , RustcDecodable , Debug , HashStable_Generic ) ]
276269pub struct Token {
277270 pub kind : TokenKind ,
@@ -735,3 +728,11 @@ impl fmt::Debug for Nonterminal {
735728 }
736729 }
737730}
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