Skip to content

Commit 8914f41

Browse files
committed
make dogfood tests happy
1 parent e286110 commit 8914f41

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clippy_lints/src/missing_fields_in_debug.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const HELP_FIELD_REFERENCE: &str = "the field referenced by this binding is unus
8888
const HELP_INCLUDE_ALL_FIELDS: &str = "consider including all fields in this `Debug` impl";
8989
const HELP_FINISH_NON_EXHAUSTIVE: &str = "consider calling `.finish_non_exhaustive()` if you intend to ignore fields";
9090

91-
fn report_lints<'tcx, I>(cx: &LateContext<'tcx>, span: Span, span_notes: I)
91+
fn report_lints<I>(cx: &LateContext<'_>, span: Span, span_notes: I)
9292
where
9393
I: Iterator<Item = (Span, &'static str)>,
9494
{
@@ -146,7 +146,7 @@ fn check_struct<'tcx>(
146146
cx: &LateContext<'tcx>,
147147
typeck_results: &TypeckResults<'tcx>,
148148
block: &'tcx Block<'tcx>,
149-
self_ty: &rustc_middle::ty::Ty<'tcx>,
149+
self_ty: rustc_middle::ty::Ty<'tcx>,
150150
item: &'tcx Item<'tcx>,
151151
data: &VariantData<'_>,
152152
) {
@@ -156,7 +156,7 @@ fn check_struct<'tcx>(
156156
if_chain! {
157157
if let ExprKind::Field(target, ident) = expr.kind;
158158
let target_ty = typeck_results.expr_ty(target).peel_refs();
159-
if target_ty == *self_ty;
159+
if target_ty == self_ty;
160160
then {
161161
field_accesses.insert(ident);
162162
}
@@ -168,10 +168,10 @@ fn check_struct<'tcx>(
168168
.fields()
169169
.iter()
170170
.filter_map(|field| {
171-
if !field_accesses.contains(&field.ident) {
172-
Some((field.span, HELP_FIELD_UNUSED))
173-
} else {
171+
if field_accesses.contains(&field.ident) {
174172
None
173+
} else {
174+
Some((field.span, HELP_FIELD_UNUSED))
175175
}
176176
})
177177
.collect::<Vec<_>>();
@@ -191,14 +191,14 @@ fn check_enum<'tcx>(
191191
cx: &LateContext<'tcx>,
192192
typeck_results: &TypeckResults<'tcx>,
193193
block: &'tcx Block<'tcx>,
194-
self_ty: &rustc_middle::ty::Ty<'tcx>,
194+
self_ty: rustc_middle::ty::Ty<'tcx>,
195195
item: &'tcx Item<'tcx>,
196196
) {
197197
let Some(arms) = for_each_expr(block, |expr| {
198198
if_chain! {
199199
if let ExprKind::Match(val, arms, MatchSource::Normal) = &expr.kind;
200200
if let match_ty = typeck_results.expr_ty(val).peel_refs();
201-
if match_ty == *self_ty;
201+
if match_ty == self_ty;
202202
then {
203203
ControlFlow::Break(arms)
204204
} else {
@@ -284,8 +284,8 @@ impl<'tcx> LateLintPass<'tcx> for MissingFieldInDebug {
284284
if should_lint(cx, typeck_results, block);
285285
then {
286286
match &self_item.kind {
287-
ItemKind::Struct(data, _) => check_struct(cx, typeck_results, block, &self_ty, item, data),
288-
ItemKind::Enum(..) => check_enum(cx, typeck_results, block, &self_ty, item),
287+
ItemKind::Struct(data, _) => check_struct(cx, typeck_results, block, self_ty, item, data),
288+
ItemKind::Enum(..) => check_enum(cx, typeck_results, block, self_ty, item),
289289
_ => {}
290290
}
291291
}

0 commit comments

Comments
 (0)