1
- use std:: { collections :: HashSet , ops:: ControlFlow } ;
1
+ use std:: ops:: ControlFlow ;
2
2
3
3
use clippy_utils:: {
4
4
diagnostics:: span_lint_and_then,
5
5
match_def_path, paths,
6
6
visitors:: { for_each_expr, Visitable } ,
7
7
} ;
8
8
use if_chain:: if_chain;
9
+ use rustc_data_structures:: fx:: FxHashSet ;
9
10
use rustc_hir:: {
10
11
def:: { DefKind , Res } ,
11
12
ImplItemKind , MatchSource , Node ,
@@ -14,6 +15,7 @@ use rustc_hir::{Block, PatKind};
14
15
use rustc_hir:: { ExprKind , Impl , ItemKind , QPath , TyKind } ;
15
16
use rustc_hir:: { ImplItem , Item , VariantData } ;
16
17
use rustc_lint:: { LateContext , LateLintPass } ;
18
+ use rustc_middle:: ty:: Ty ;
17
19
use rustc_middle:: ty:: TypeckResults ;
18
20
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
19
21
use rustc_span:: { sym, Span } ;
@@ -143,11 +145,11 @@ fn check_struct<'tcx>(
143
145
cx : & LateContext < ' tcx > ,
144
146
typeck_results : & TypeckResults < ' tcx > ,
145
147
block : & ' tcx Block < ' tcx > ,
146
- self_ty : rustc_middle :: ty :: Ty < ' tcx > ,
148
+ self_ty : Ty < ' tcx > ,
147
149
item : & ' tcx Item < ' tcx > ,
148
150
data : & VariantData < ' _ > ,
149
151
) {
150
- let mut field_accesses = HashSet :: new ( ) ;
152
+ let mut field_accesses = FxHashSet :: default ( ) ;
151
153
152
154
let _: Option < !> = for_each_expr ( block, |expr| {
153
155
if_chain ! {
@@ -188,7 +190,7 @@ fn check_enum<'tcx>(
188
190
cx : & LateContext < ' tcx > ,
189
191
typeck_results : & TypeckResults < ' tcx > ,
190
192
block : & ' tcx Block < ' tcx > ,
191
- self_ty : rustc_middle :: ty :: Ty < ' tcx > ,
193
+ self_ty : Ty < ' tcx > ,
192
194
item : & ' tcx Item < ' tcx > ,
193
195
) {
194
196
let Some ( arms) = for_each_expr ( block, |expr| {
@@ -222,7 +224,7 @@ fn check_enum<'tcx>(
222
224
_ => { } ,
223
225
} ) ;
224
226
225
- let mut field_accesses = HashSet :: new ( ) ;
227
+ let mut field_accesses = FxHashSet :: default ( ) ;
226
228
227
229
let _: Option < !> = for_each_expr ( arm. body , |expr| {
228
230
if_chain ! {
0 commit comments