@@ -7,6 +7,7 @@ use clippy_utils::{is_expn_of, is_lint_allowed, path_to_local};
77use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap } ;
88use rustc_errors:: Applicability ;
99use rustc_hir as hir;
10+ use rustc_hir:: HirId ;
1011use rustc_hir:: intravisit:: { self , Visitor } ;
1112use rustc_lint:: { LateContext , LateLintPass } ;
1213use rustc_middle:: hir:: nested_filter;
@@ -87,9 +88,9 @@ impl<'tcx> LateLintPass<'tcx> for IndexRefutableSlice {
8788 extract_msrv_attr ! ( LateContext ) ;
8889}
8990
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 ( ) ;
9394 pat. walk_always ( |pat| {
9495 // We'll just ignore mut and ref mut for simplicity sake right now
9596 if let hir:: PatKind :: Binding (
@@ -206,10 +207,10 @@ impl SliceLintInformation {
206207
207208fn filter_lintable_slices < ' tcx > (
208209 cx : & LateContext < ' tcx > ,
209- slice_lint_info : FxIndexMap < hir :: HirId , SliceLintInformation > ,
210+ slice_lint_info : FxIndexMap < HirId , SliceLintInformation > ,
210211 max_suggested_slice : u64 ,
211212 scope : & ' tcx hir:: Expr < ' tcx > ,
212- ) -> FxIndexMap < hir :: HirId , SliceLintInformation > {
213+ ) -> FxIndexMap < HirId , SliceLintInformation > {
213214 let mut visitor = SliceIndexLintingVisitor {
214215 cx,
215216 slice_lint_info,
@@ -223,7 +224,7 @@ fn filter_lintable_slices<'tcx>(
223224
224225struct SliceIndexLintingVisitor < ' a , ' tcx > {
225226 cx : & ' a LateContext < ' tcx > ,
226- slice_lint_info : FxIndexMap < hir :: HirId , SliceLintInformation > ,
227+ slice_lint_info : FxIndexMap < HirId , SliceLintInformation > ,
227228 max_suggested_slice : u64 ,
228229}
229230
0 commit comments