@@ -15,19 +15,15 @@ use std::hash::{Hasher, Hash};
1515use std:: io;
1616use syntax:: ast;
1717
18- #[ cfg( not( stage0) ) ]
1918pub type FnvHashMap < K , V > = HashMap < K , V , FnvHasher > ;
2019
2120pub type NodeMap < T > = FnvHashMap < ast:: NodeId , T > ;
2221pub type DefIdMap < T > = FnvHashMap < ast:: DefId , T > ;
2322
24- #[ cfg( not( stage0) ) ]
2523pub type NodeSet = HashSet < ast:: NodeId , FnvHasher > ;
26- #[ cfg( not( stage0) ) ]
2724pub type DefIdSet = HashSet < ast:: DefId , FnvHasher > ;
2825
2926// Hacks to get good names
30- #[ cfg( not( stage0) ) ]
3127pub mod FnvHashMap {
3228 use std:: hash:: Hash ;
3329 use collections:: HashMap ;
@@ -45,53 +41,19 @@ pub mod DefIdMap {
4541 super :: FnvHashMap :: new ( )
4642 }
4743}
48- #[ cfg( not( stage0) ) ]
4944pub mod NodeSet {
5045 use collections:: HashSet ;
5146 pub fn new ( ) -> super :: NodeSet {
5247 HashSet :: with_hasher ( super :: FnvHasher )
5348 }
5449}
55- #[ cfg( not( stage0) ) ]
5650pub mod DefIdSet {
5751 use collections:: HashSet ;
5852 pub fn new ( ) -> super :: DefIdSet {
5953 HashSet :: with_hasher ( super :: FnvHasher )
6054 }
6155}
6256
63- #[ cfg( stage0) ]
64- pub type FnvHashMap < K , V > = HashMap < K , V > ;
65-
66- #[ cfg( stage0) ]
67- pub type NodeSet = HashSet < ast:: NodeId > ;
68- #[ cfg( stage0) ]
69- pub type DefIdSet = HashSet < ast:: DefId > ;
70-
71- // Hacks to get good names
72- #[ cfg( stage0) ]
73- pub mod FnvHashMap {
74- use std:: hash:: Hash ;
75- use collections:: HashMap ;
76- pub fn new < K : Hash + Eq , V > ( ) -> super :: FnvHashMap < K , V > {
77- HashMap :: new ( )
78- }
79- }
80- #[ cfg( stage0) ]
81- pub mod NodeSet {
82- use collections:: HashSet ;
83- pub fn new ( ) -> super :: NodeSet {
84- HashSet :: new ( )
85- }
86- }
87- #[ cfg( stage0) ]
88- pub mod DefIdSet {
89- use collections:: HashSet ;
90- pub fn new ( ) -> super :: DefIdSet {
91- HashSet :: new ( )
92- }
93- }
94-
9557/// A speedy hash algorithm for node ids and def ids. The hashmap in
9658/// libcollections by default uses SipHash which isn't quite as speedy as we
9759/// want. In the compiler we're not really worried about DOS attempts, so we
0 commit comments