@@ -4,7 +4,7 @@ use clippy_utils::higher::IfLet;
44use clippy_utils:: ty:: is_copy;
55use clippy_utils:: { is_expn_of, is_lint_allowed, meets_msrv, msrvs, path_to_local} ;
66use if_chain:: if_chain;
7- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
7+ use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap } ;
88use rustc_errors:: Applicability ;
99use rustc_hir as hir;
1010use rustc_hir:: intravisit:: { self , Visitor } ;
@@ -92,9 +92,9 @@ impl<'tcx> LateLintPass<'tcx> for IndexRefutableSlice {
9292 extract_msrv_attr ! ( LateContext ) ;
9393}
9494
95- fn find_slice_values ( cx : & LateContext < ' _ > , pat : & hir:: Pat < ' _ > ) -> FxHashMap < hir:: HirId , SliceLintInformation > {
95+ fn find_slice_values ( cx : & LateContext < ' _ > , pat : & hir:: Pat < ' _ > ) -> FxIndexMap < hir:: HirId , SliceLintInformation > {
9696 let mut removed_pat: FxHashSet < hir:: HirId > = FxHashSet :: default ( ) ;
97- let mut slices: FxHashMap < hir:: HirId , SliceLintInformation > = FxHashMap :: default ( ) ;
97+ let mut slices: FxIndexMap < hir:: HirId , SliceLintInformation > = FxIndexMap :: default ( ) ;
9898 pat. walk_always ( |pat| {
9999 if let hir:: PatKind :: Binding ( binding, value_hir_id, ident, sub_pat) = pat. kind {
100100 // We'll just ignore mut and ref mut for simplicity sake right now
@@ -208,10 +208,10 @@ impl SliceLintInformation {
208208
209209fn filter_lintable_slices < ' a , ' tcx > (
210210 cx : & ' a LateContext < ' tcx > ,
211- slice_lint_info : FxHashMap < hir:: HirId , SliceLintInformation > ,
211+ slice_lint_info : FxIndexMap < hir:: HirId , SliceLintInformation > ,
212212 max_suggested_slice : u64 ,
213213 scope : & ' tcx hir:: Expr < ' tcx > ,
214- ) -> FxHashMap < hir:: HirId , SliceLintInformation > {
214+ ) -> FxIndexMap < hir:: HirId , SliceLintInformation > {
215215 let mut visitor = SliceIndexLintingVisitor {
216216 cx,
217217 slice_lint_info,
@@ -225,7 +225,7 @@ fn filter_lintable_slices<'a, 'tcx>(
225225
226226struct SliceIndexLintingVisitor < ' a , ' tcx > {
227227 cx : & ' a LateContext < ' tcx > ,
228- slice_lint_info : FxHashMap < hir:: HirId , SliceLintInformation > ,
228+ slice_lint_info : FxIndexMap < hir:: HirId , SliceLintInformation > ,
229229 max_suggested_slice : u64 ,
230230}
231231
0 commit comments