@@ -4,7 +4,7 @@ use clippy_utils::higher::IfLet;
4
4
use clippy_utils:: ty:: is_copy;
5
5
use clippy_utils:: { is_expn_of, is_lint_allowed, meets_msrv, msrvs, path_to_local} ;
6
6
use if_chain:: if_chain;
7
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
7
+ use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap } ;
8
8
use rustc_errors:: Applicability ;
9
9
use rustc_hir as hir;
10
10
use rustc_hir:: intravisit:: { self , Visitor } ;
@@ -92,9 +92,9 @@ impl<'tcx> LateLintPass<'tcx> for IndexRefutableSlice {
92
92
extract_msrv_attr ! ( LateContext ) ;
93
93
}
94
94
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 > {
96
96
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 ( ) ;
98
98
pat. walk_always ( |pat| {
99
99
if let hir:: PatKind :: Binding ( binding, value_hir_id, ident, sub_pat) = pat. kind {
100
100
// We'll just ignore mut and ref mut for simplicity sake right now
@@ -208,10 +208,10 @@ impl SliceLintInformation {
208
208
209
209
fn filter_lintable_slices < ' a , ' tcx > (
210
210
cx : & ' a LateContext < ' tcx > ,
211
- slice_lint_info : FxHashMap < hir:: HirId , SliceLintInformation > ,
211
+ slice_lint_info : FxIndexMap < hir:: HirId , SliceLintInformation > ,
212
212
max_suggested_slice : u64 ,
213
213
scope : & ' tcx hir:: Expr < ' tcx > ,
214
- ) -> FxHashMap < hir:: HirId , SliceLintInformation > {
214
+ ) -> FxIndexMap < hir:: HirId , SliceLintInformation > {
215
215
let mut visitor = SliceIndexLintingVisitor {
216
216
cx,
217
217
slice_lint_info,
@@ -225,7 +225,7 @@ fn filter_lintable_slices<'a, 'tcx>(
225
225
226
226
struct SliceIndexLintingVisitor < ' a , ' tcx > {
227
227
cx : & ' a LateContext < ' tcx > ,
228
- slice_lint_info : FxHashMap < hir:: HirId , SliceLintInformation > ,
228
+ slice_lint_info : FxIndexMap < hir:: HirId , SliceLintInformation > ,
229
229
max_suggested_slice : u64 ,
230
230
}
231
231
0 commit comments