@@ -272,7 +272,7 @@ impl RibKind<'_> {
272
272
/// resolving, the name is looked up from inside out.
273
273
#[ derive( Debug ) ]
274
274
pub ( crate ) struct Rib < ' ra , R = Res > {
275
- pub bindings : FxHashMap < Ident , R > ,
275
+ pub bindings : FxIndexMap < Ident , R > ,
276
276
pub patterns_with_skipped_bindings : UnordMap < DefId , Vec < ( Span , Result < ( ) , ErrorGuaranteed > ) > > ,
277
277
pub kind : RibKind < ' ra > ,
278
278
}
@@ -1642,8 +1642,8 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1642
1642
1643
1643
// Allow all following defaults to refer to this type parameter.
1644
1644
let i = & Ident :: with_dummy_span ( param. ident . name ) ;
1645
- forward_ty_ban_rib. bindings . remove ( i) ;
1646
- forward_ty_ban_rib_const_param_ty. bindings . remove ( i) ;
1645
+ forward_ty_ban_rib. bindings . swap_remove ( i) ;
1646
+ forward_ty_ban_rib_const_param_ty. bindings . swap_remove ( i) ;
1647
1647
}
1648
1648
GenericParamKind :: Const { ref ty, kw_span : _, ref default } => {
1649
1649
// Const parameters can't have param bounds.
@@ -1678,8 +1678,8 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1678
1678
1679
1679
// Allow all following defaults to refer to this const parameter.
1680
1680
let i = & Ident :: with_dummy_span ( param. ident . name ) ;
1681
- forward_const_ban_rib. bindings . remove ( i) ;
1682
- forward_const_ban_rib_const_param_ty. bindings . remove ( i) ;
1681
+ forward_const_ban_rib. bindings . swap_remove ( i) ;
1682
+ forward_const_ban_rib_const_param_ty. bindings . swap_remove ( i) ;
1683
1683
}
1684
1684
}
1685
1685
}
@@ -2888,7 +2888,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2888
2888
break ;
2889
2889
}
2890
2890
2891
- #[ allow( rustc:: potential_query_instability) ] // FIXME
2892
2891
seen_bindings
2893
2892
. extend ( parent_rib. bindings . keys ( ) . map ( |ident| ( * ident, ident. span ) ) ) ;
2894
2893
}
@@ -4003,7 +4002,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
4003
4002
}
4004
4003
}
4005
4004
4006
- fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut FxHashMap < Ident , Res > {
4005
+ fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut FxIndexMap < Ident , Res > {
4007
4006
& mut self . ribs [ ns] . last_mut ( ) . unwrap ( ) . bindings
4008
4007
}
4009
4008
0 commit comments