Skip to content

Commit c8844d6

Browse files
committed
replace HashSet with FxHashSet
1 parent 580f9a7 commit c8844d6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

clippy_lints/src/missing_fields_in_debug.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
use std::{collections::HashSet, ops::ControlFlow};
1+
use std::ops::ControlFlow;
22

33
use clippy_utils::{
44
diagnostics::span_lint_and_then,
55
match_def_path, paths,
66
visitors::{for_each_expr, Visitable},
77
};
88
use if_chain::if_chain;
9+
use rustc_data_structures::fx::FxHashSet;
910
use rustc_hir::{
1011
def::{DefKind, Res},
1112
ImplItemKind, MatchSource, Node,
@@ -14,6 +15,7 @@ use rustc_hir::{Block, PatKind};
1415
use rustc_hir::{ExprKind, Impl, ItemKind, QPath, TyKind};
1516
use rustc_hir::{ImplItem, Item, VariantData};
1617
use rustc_lint::{LateContext, LateLintPass};
18+
use rustc_middle::ty::Ty;
1719
use rustc_middle::ty::TypeckResults;
1820
use rustc_session::{declare_lint_pass, declare_tool_lint};
1921
use rustc_span::{sym, Span};
@@ -143,11 +145,11 @@ fn check_struct<'tcx>(
143145
cx: &LateContext<'tcx>,
144146
typeck_results: &TypeckResults<'tcx>,
145147
block: &'tcx Block<'tcx>,
146-
self_ty: rustc_middle::ty::Ty<'tcx>,
148+
self_ty: Ty<'tcx>,
147149
item: &'tcx Item<'tcx>,
148150
data: &VariantData<'_>,
149151
) {
150-
let mut field_accesses = HashSet::new();
152+
let mut field_accesses = FxHashSet::default();
151153

152154
let _: Option<!> = for_each_expr(block, |expr| {
153155
if_chain! {
@@ -188,7 +190,7 @@ fn check_enum<'tcx>(
188190
cx: &LateContext<'tcx>,
189191
typeck_results: &TypeckResults<'tcx>,
190192
block: &'tcx Block<'tcx>,
191-
self_ty: rustc_middle::ty::Ty<'tcx>,
193+
self_ty: Ty<'tcx>,
192194
item: &'tcx Item<'tcx>,
193195
) {
194196
let Some(arms) = for_each_expr(block, |expr| {
@@ -222,7 +224,7 @@ fn check_enum<'tcx>(
222224
_ => {},
223225
});
224226

225-
let mut field_accesses = HashSet::new();
227+
let mut field_accesses = FxHashSet::default();
226228

227229
let _: Option<!> = for_each_expr(arm.body, |expr| {
228230
if_chain! {

0 commit comments

Comments
 (0)