@@ -15,14 +15,14 @@ use rustc_span::{Ident, Symbol};
15
15
use crate :: ast;
16
16
use crate :: util:: case:: Case ;
17
17
18
- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
18
+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
19
19
pub enum CommentKind {
20
20
Line ,
21
21
Block ,
22
22
}
23
23
24
24
// This type must not implement `Hash` due to the unusual `PartialEq` impl below.
25
- #[ derive( Copy , Clone , Debug , Encodable , Decodable , HashStable_Generic ) ]
25
+ #[ derive( Copy , Clone , Debug , Hash , Encodable , Decodable , HashStable_Generic ) ]
26
26
pub enum InvisibleOrigin {
27
27
// From the expansion of a metavariable in a declarative macro.
28
28
MetaVar ( MetaVarKind ) ,
@@ -113,7 +113,7 @@ impl fmt::Display for MetaVarKind {
113
113
/// Describes how a sequence of token trees is delimited.
114
114
/// Cannot use `proc_macro::Delimiter` directly because this
115
115
/// structure should implement some additional traits.
116
- #[ derive( Copy , Clone , Debug , PartialEq , Encodable , Decodable , HashStable_Generic ) ]
116
+ #[ derive( Copy , Clone , Debug , PartialEq , Hash , Encodable , Decodable , HashStable_Generic ) ]
117
117
pub enum Delimiter {
118
118
/// `( ... )`
119
119
Parenthesis ,
@@ -175,7 +175,7 @@ impl Delimiter {
175
175
// type. This means that float literals like `1f32` are classified by this type
176
176
// as `Int`. Only upon conversion to `ast::LitKind` will such a literal be
177
177
// given the `Float` kind.
178
- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
178
+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
179
179
pub enum LitKind {
180
180
Bool , // AST only, must never appear in a `Token`
181
181
Byte ,
@@ -192,7 +192,7 @@ pub enum LitKind {
192
192
}
193
193
194
194
/// A literal token.
195
- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
195
+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
196
196
pub struct Lit {
197
197
pub kind : LitKind ,
198
198
pub symbol : Symbol ,
@@ -338,7 +338,7 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: IdentIsRaw) -> bool {
338
338
. contains ( & name)
339
339
}
340
340
341
- #[ derive( PartialEq , Encodable , Decodable , Debug , Copy , Clone , HashStable_Generic ) ]
341
+ #[ derive( PartialEq , Encodable , Decodable , Hash , Debug , Copy , Clone , HashStable_Generic ) ]
342
342
pub enum IdentIsRaw {
343
343
No ,
344
344
Yes ,
@@ -356,7 +356,7 @@ impl From<IdentIsRaw> for bool {
356
356
}
357
357
}
358
358
359
- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
359
+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
360
360
pub enum TokenKind {
361
361
/* Expression-operator symbols. */
362
362
/// `=`
@@ -506,7 +506,7 @@ pub enum TokenKind {
506
506
Eof ,
507
507
}
508
508
509
- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
509
+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
510
510
pub struct Token {
511
511
pub kind : TokenKind ,
512
512
pub span : Span ,
0 commit comments