File tree Expand file tree Collapse file tree 2 files changed +17
-20
lines changed Expand file tree Collapse file tree 2 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -10,31 +10,12 @@ use syntax::ast;
10
10
use syntax:: feature_gate;
11
11
use syntax:: token;
12
12
use syntax:: tokenstream;
13
- use syntax_pos:: symbol:: SymbolStr ;
14
13
use syntax_pos:: SourceFile ;
15
14
16
15
use crate :: hir:: def_id:: { DefId , CrateNum , CRATE_DEF_INDEX } ;
17
16
18
17
use smallvec:: SmallVec ;
19
- use rustc_data_structures:: stable_hasher:: { HashStable , ToStableHashKey , StableHasher } ;
20
-
21
- impl < ' a > HashStable < StableHashingContext < ' a > > for ast:: Name {
22
- #[ inline]
23
- fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
24
- self . as_str ( ) . hash_stable ( hcx, hasher) ;
25
- }
26
- }
27
-
28
- impl < ' a > ToStableHashKey < StableHashingContext < ' a > > for ast:: Name {
29
- type KeyType = SymbolStr ;
30
-
31
- #[ inline]
32
- fn to_stable_hash_key ( & self ,
33
- _: & StableHashingContext < ' a > )
34
- -> SymbolStr {
35
- self . as_str ( )
36
- }
37
- }
18
+ use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
38
19
39
20
impl_stable_hash_for ! ( enum :: syntax_pos:: hygiene:: MacroKind {
40
21
Bang ,
Original file line number Diff line number Diff line change @@ -940,6 +940,22 @@ impl Decodable for Symbol {
940
940
}
941
941
}
942
942
943
+ impl < CTX > HashStable < CTX > for Symbol {
944
+ #[ inline]
945
+ fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
946
+ self . as_str ( ) . hash_stable ( hcx, hasher) ;
947
+ }
948
+ }
949
+
950
+ impl < CTX > ToStableHashKey < CTX > for Symbol {
951
+ type KeyType = SymbolStr ;
952
+
953
+ #[ inline]
954
+ fn to_stable_hash_key ( & self , _: & CTX ) -> SymbolStr {
955
+ self . as_str ( )
956
+ }
957
+ }
958
+
943
959
// The `&'static str`s in this type actually point into the arena.
944
960
#[ derive( Default ) ]
945
961
pub struct Interner {
You can’t perform that action at this time.
0 commit comments