@@ -35,7 +35,7 @@ use std::{iter, mem};
3535///
3636/// The RHS of an MBE macro is the only place `SubstNt`s are substituted.
3737/// Nothing special happens to misnamed or misplaced `SubstNt`s.
38- #[ derive( Debug , Clone , PartialEq , RustcEncodable , RustcDecodable ) ]
38+ #[ derive( Debug , Clone , PartialEq , RustcEncodable , RustcDecodable , HashStable_Generic ) ]
3939pub enum TokenTree {
4040 /// A single token
4141 Token ( Token ) ,
5353 TokenStream : Send + Sync ,
5454{ }
5555
56- impl < CTX > HashStable < CTX > for TokenTree
57- where CTX : crate :: HashStableContext
58- {
59- fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
60- mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
61- match * self {
62- TokenTree :: Token ( ref token) => {
63- token. hash_stable ( hcx, hasher) ;
64- }
65- TokenTree :: Delimited ( span, delim, ref tts) => {
66- span. hash_stable ( hcx, hasher) ;
67- std:: hash:: Hash :: hash ( & delim, hasher) ;
68- for sub_tt in tts. trees ( ) {
69- sub_tt. hash_stable ( hcx, hasher) ;
70- }
71- }
72- }
73- }
74- }
75-
7656impl TokenTree {
7757 /// Checks if this TokenTree is equal to the other, regardless of span information.
7858 pub fn eq_unspanned ( & self , other : & TokenTree ) -> bool {
0 commit comments