@@ -88,7 +88,7 @@ const HELP_FIELD_REFERENCE: &str = "the field referenced by this binding is unus
88
88
const HELP_INCLUDE_ALL_FIELDS : & str = "consider including all fields in this `Debug` impl" ;
89
89
const HELP_FINISH_NON_EXHAUSTIVE : & str = "consider calling `.finish_non_exhaustive()` if you intend to ignore fields" ;
90
90
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 )
92
92
where
93
93
I : Iterator < Item = ( Span , & ' static str ) > ,
94
94
{
@@ -146,7 +146,7 @@ fn check_struct<'tcx>(
146
146
cx : & LateContext < ' tcx > ,
147
147
typeck_results : & TypeckResults < ' tcx > ,
148
148
block : & ' tcx Block < ' tcx > ,
149
- self_ty : & rustc_middle:: ty:: Ty < ' tcx > ,
149
+ self_ty : rustc_middle:: ty:: Ty < ' tcx > ,
150
150
item : & ' tcx Item < ' tcx > ,
151
151
data : & VariantData < ' _ > ,
152
152
) {
@@ -156,7 +156,7 @@ fn check_struct<'tcx>(
156
156
if_chain ! {
157
157
if let ExprKind :: Field ( target, ident) = expr. kind;
158
158
let target_ty = typeck_results. expr_ty( target) . peel_refs( ) ;
159
- if target_ty == * self_ty;
159
+ if target_ty == self_ty;
160
160
then {
161
161
field_accesses. insert( ident) ;
162
162
}
@@ -168,10 +168,10 @@ fn check_struct<'tcx>(
168
168
. fields ( )
169
169
. iter ( )
170
170
. 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 ) {
174
172
None
173
+ } else {
174
+ Some ( ( field. span , HELP_FIELD_UNUSED ) )
175
175
}
176
176
} )
177
177
. collect :: < Vec < _ > > ( ) ;
@@ -191,14 +191,14 @@ fn check_enum<'tcx>(
191
191
cx : & LateContext < ' tcx > ,
192
192
typeck_results : & TypeckResults < ' tcx > ,
193
193
block : & ' tcx Block < ' tcx > ,
194
- self_ty : & rustc_middle:: ty:: Ty < ' tcx > ,
194
+ self_ty : rustc_middle:: ty:: Ty < ' tcx > ,
195
195
item : & ' tcx Item < ' tcx > ,
196
196
) {
197
197
let Some ( arms) = for_each_expr ( block, |expr| {
198
198
if_chain ! {
199
199
if let ExprKind :: Match ( val, arms, MatchSource :: Normal ) = & expr. kind;
200
200
if let match_ty = typeck_results. expr_ty( val) . peel_refs( ) ;
201
- if match_ty == * self_ty;
201
+ if match_ty == self_ty;
202
202
then {
203
203
ControlFlow :: Break ( arms)
204
204
} else {
@@ -284,8 +284,8 @@ impl<'tcx> LateLintPass<'tcx> for MissingFieldInDebug {
284
284
if should_lint( cx, typeck_results, block) ;
285
285
then {
286
286
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) ,
289
289
_ => { }
290
290
}
291
291
}
0 commit comments