@@ -8,6 +8,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 } ;
11
+ use rustc_hir:: HirId ;
11
12
use rustc_lint:: { LateContext , LateLintPass } ;
12
13
use rustc_middle:: hir:: nested_filter;
13
14
use rustc_middle:: ty;
@@ -87,9 +88,9 @@ impl<'tcx> LateLintPass<'tcx> for IndexRefutableSlice {
87
88
extract_msrv_attr ! ( LateContext ) ;
88
89
}
89
90
90
- fn find_slice_values ( cx : & LateContext < ' _ > , pat : & hir:: Pat < ' _ > ) -> FxIndexMap < hir :: HirId , SliceLintInformation > {
91
- let mut removed_pat: FxHashSet < hir :: HirId > = FxHashSet :: default ( ) ;
92
- let mut slices: FxIndexMap < hir :: HirId , SliceLintInformation > = FxIndexMap :: default ( ) ;
91
+ fn find_slice_values ( cx : & LateContext < ' _ > , pat : & hir:: Pat < ' _ > ) -> FxIndexMap < HirId , SliceLintInformation > {
92
+ let mut removed_pat: FxHashSet < HirId > = FxHashSet :: default ( ) ;
93
+ let mut slices: FxIndexMap < HirId , SliceLintInformation > = FxIndexMap :: default ( ) ;
93
94
pat. walk_always ( |pat| {
94
95
// We'll just ignore mut and ref mut for simplicity sake right now
95
96
if let hir:: PatKind :: Binding (
@@ -206,10 +207,10 @@ impl SliceLintInformation {
206
207
207
208
fn filter_lintable_slices < ' tcx > (
208
209
cx : & LateContext < ' tcx > ,
209
- slice_lint_info : FxIndexMap < hir :: HirId , SliceLintInformation > ,
210
+ slice_lint_info : FxIndexMap < HirId , SliceLintInformation > ,
210
211
max_suggested_slice : u64 ,
211
212
scope : & ' tcx hir:: Expr < ' tcx > ,
212
- ) -> FxIndexMap < hir :: HirId , SliceLintInformation > {
213
+ ) -> FxIndexMap < HirId , SliceLintInformation > {
213
214
let mut visitor = SliceIndexLintingVisitor {
214
215
cx,
215
216
slice_lint_info,
@@ -223,7 +224,7 @@ fn filter_lintable_slices<'tcx>(
223
224
224
225
struct SliceIndexLintingVisitor < ' a , ' tcx > {
225
226
cx : & ' a LateContext < ' tcx > ,
226
- slice_lint_info : FxIndexMap < hir :: HirId , SliceLintInformation > ,
227
+ slice_lint_info : FxIndexMap < HirId , SliceLintInformation > ,
227
228
max_suggested_slice : u64 ,
228
229
}
229
230
0 commit comments