@@ -15,14 +15,14 @@ use rustc_span::{Ident, Symbol};
1515use crate :: ast;
1616use crate :: util:: case:: Case ;
1717
18- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
18+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
1919pub enum CommentKind {
2020 Line ,
2121 Block ,
2222}
2323
2424// 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 ) ]
2626pub enum InvisibleOrigin {
2727 // From the expansion of a metavariable in a declarative macro.
2828 MetaVar ( MetaVarKind ) ,
@@ -113,7 +113,7 @@ impl fmt::Display for MetaVarKind {
113113/// Describes how a sequence of token trees is delimited.
114114/// Cannot use `proc_macro::Delimiter` directly because this
115115/// 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 ) ]
117117pub enum Delimiter {
118118 /// `( ... )`
119119 Parenthesis ,
@@ -175,7 +175,7 @@ impl Delimiter {
175175// type. This means that float literals like `1f32` are classified by this type
176176// as `Int`. Only upon conversion to `ast::LitKind` will such a literal be
177177// 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 ) ]
179179pub enum LitKind {
180180 Bool , // AST only, must never appear in a `Token`
181181 Byte ,
@@ -192,7 +192,7 @@ pub enum LitKind {
192192}
193193
194194/// A literal token.
195- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
195+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
196196pub struct Lit {
197197 pub kind : LitKind ,
198198 pub symbol : Symbol ,
@@ -338,7 +338,7 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: IdentIsRaw) -> bool {
338338 . contains ( & name)
339339}
340340
341- #[ derive( PartialEq , Encodable , Decodable , Debug , Copy , Clone , HashStable_Generic ) ]
341+ #[ derive( PartialEq , Encodable , Decodable , Hash , Debug , Copy , Clone , HashStable_Generic ) ]
342342pub enum IdentIsRaw {
343343 No ,
344344 Yes ,
@@ -356,7 +356,7 @@ impl From<IdentIsRaw> for bool {
356356 }
357357}
358358
359- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
359+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
360360pub enum TokenKind {
361361 /* Expression-operator symbols. */
362362 /// `=`
@@ -506,7 +506,7 @@ pub enum TokenKind {
506506 Eof ,
507507}
508508
509- #[ derive( Clone , Copy , PartialEq , Encodable , Decodable , Debug , HashStable_Generic ) ]
509+ #[ derive( Clone , Copy , PartialEq , Hash , Encodable , Decodable , Debug , HashStable_Generic ) ]
510510pub struct Token {
511511 pub kind : TokenKind ,
512512 pub span : Span ,
0 commit comments