@@ -35,8 +35,10 @@ mod diagnostics;
35
35
36
36
type Res = def:: Res < NodeId > ;
37
37
38
+ type IdentMap < T > = FxHashMap < Ident , T > ;
39
+
38
40
/// Map from the name in a pattern to its binding mode.
39
- type BindingMap = FxHashMap < Ident , BindingInfo > ;
41
+ type BindingMap = IdentMap < BindingInfo > ;
40
42
41
43
#[ derive( Copy , Clone , Debug ) ]
42
44
struct BindingInfo {
@@ -143,7 +145,7 @@ impl RibKind<'_> {
143
145
/// resolving, the name is looked up from inside out.
144
146
#[ derive( Debug ) ]
145
147
crate struct Rib < ' a , R = Res > {
146
- pub bindings : FxHashMap < Ident , R > ,
148
+ pub bindings : IdentMap < R > ,
147
149
pub kind : RibKind < ' a > ,
148
150
}
149
151
@@ -1275,7 +1277,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
1275
1277
pat_id : NodeId ,
1276
1278
outer_pat_id : NodeId ,
1277
1279
pat_src : PatternSource ,
1278
- bindings : & mut FxHashMap < Ident , NodeId > )
1280
+ bindings : & mut IdentMap < NodeId > )
1279
1281
-> Res {
1280
1282
// Add the binding to the local ribs, if it
1281
1283
// doesn't already exist in the bindings map. (We
@@ -1323,7 +1325,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
1323
1325
res
1324
1326
}
1325
1327
1326
- fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut FxHashMap < Ident , Res > {
1328
+ fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut IdentMap < Res > {
1327
1329
& mut self . ribs [ ns] . last_mut ( ) . unwrap ( ) . bindings
1328
1330
}
1329
1331
@@ -1332,7 +1334,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> {
1332
1334
pat : & Pat ,
1333
1335
pat_src : PatternSource ,
1334
1336
// Maps idents to the node ID for the outermost pattern that binds them.
1335
- bindings : & mut FxHashMap < Ident , NodeId > ,
1337
+ bindings : & mut IdentMap < NodeId > ,
1336
1338
) {
1337
1339
// Visit all direct subpatterns of this pattern.
1338
1340
let outer_pat_id = pat. id ;
0 commit comments