@@ -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
}
@@ -672,7 +672,7 @@ struct DiagMetadata<'ast> {
672
672
673
673
/// A list of labels as of yet unused. Labels will be removed from this map when
674
674
/// they are used (in a `break` or `continue` statement)
675
- unused_labels : FxHashMap < NodeId , Span > ,
675
+ unused_labels : FxIndexMap < NodeId , Span > ,
676
676
677
677
/// Only used for better errors on `let x = { foo: bar };`.
678
678
/// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
@@ -1639,8 +1639,8 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1639
1639
1640
1640
// Allow all following defaults to refer to this type parameter.
1641
1641
let i = & Ident :: with_dummy_span ( param. ident . name ) ;
1642
- forward_ty_ban_rib. bindings . remove ( i) ;
1643
- forward_ty_ban_rib_const_param_ty. bindings . remove ( i) ;
1642
+ forward_ty_ban_rib. bindings . swap_remove ( i) ;
1643
+ forward_ty_ban_rib_const_param_ty. bindings . swap_remove ( i) ;
1644
1644
}
1645
1645
GenericParamKind :: Const { ref ty, kw_span : _, ref default } => {
1646
1646
// Const parameters can't have param bounds.
@@ -1675,8 +1675,8 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
1675
1675
1676
1676
// Allow all following defaults to refer to this const parameter.
1677
1677
let i = & Ident :: with_dummy_span ( param. ident . name ) ;
1678
- forward_const_ban_rib. bindings . remove ( i) ;
1679
- forward_const_ban_rib_const_param_ty. bindings . remove ( i) ;
1678
+ forward_const_ban_rib. bindings . swap_remove ( i) ;
1679
+ forward_const_ban_rib_const_param_ty. bindings . swap_remove ( i) ;
1680
1680
}
1681
1681
}
1682
1682
}
@@ -2885,7 +2885,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
2885
2885
break ;
2886
2886
}
2887
2887
2888
- #[ allow( rustc:: potential_query_instability) ] // FIXME
2889
2888
seen_bindings
2890
2889
. extend ( parent_rib. bindings . keys ( ) . map ( |ident| ( * ident, ident. span ) ) ) ;
2891
2890
}
@@ -4000,7 +3999,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
4000
3999
}
4001
4000
}
4002
4001
4003
- fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut FxHashMap < Ident , Res > {
4002
+ fn innermost_rib_bindings ( & mut self , ns : Namespace ) -> & mut FxIndexMap < Ident , Res > {
4004
4003
& mut self . ribs [ ns] . last_mut ( ) . unwrap ( ) . bindings
4005
4004
}
4006
4005
@@ -4776,7 +4775,7 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
4776
4775
Ok ( ( node_id, _) ) => {
4777
4776
// Since this res is a label, it is never read.
4778
4777
self . r . label_res_map . insert ( expr. id , node_id) ;
4779
- self . diag_metadata . unused_labels . remove ( & node_id) ;
4778
+ self . diag_metadata . unused_labels . swap_remove ( & node_id) ;
4780
4779
}
4781
4780
Err ( error) => {
4782
4781
self . report_error ( label. ident . span , error) ;
@@ -5198,7 +5197,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
5198
5197
let mut late_resolution_visitor = LateResolutionVisitor :: new ( self ) ;
5199
5198
late_resolution_visitor. resolve_doc_links ( & krate. attrs , MaybeExported :: Ok ( CRATE_NODE_ID ) ) ;
5200
5199
visit:: walk_crate ( & mut late_resolution_visitor, krate) ;
5201
- #[ allow( rustc:: potential_query_instability) ] // FIXME
5202
5200
for ( id, span) in late_resolution_visitor. diag_metadata . unused_labels . iter ( ) {
5203
5201
self . lint_buffer . buffer_lint (
5204
5202
lint:: builtin:: UNUSED_LABELS ,
0 commit comments