@@ -35,7 +35,7 @@ use std::{iter, mem};
35
35
///
36
36
/// The RHS of an MBE macro is the only place `SubstNt`s are substituted.
37
37
/// 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 ) ]
39
39
pub enum TokenTree {
40
40
/// A single token
41
41
Token ( Token ) ,
53
53
TokenStream : Send + Sync ,
54
54
{ }
55
55
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
-
76
56
impl TokenTree {
77
57
/// Checks if this TokenTree is equal to the other, regardless of span information.
78
58
pub fn eq_unspanned ( & self , other : & TokenTree ) -> bool {
0 commit comments