@@ -187,9 +187,7 @@ fn filtered_statement_span(statement: &Statement<'_>) -> Option<Span> {
187
187
// for their parent `BasicBlock`.
188
188
StatementKind :: StorageLive ( _)
189
189
| StatementKind :: StorageDead ( _)
190
- // Ignore `ConstEvalCounter`s
191
190
| StatementKind :: ConstEvalCounter
192
- // Ignore `Nop`s
193
191
| StatementKind :: Nop => None ,
194
192
195
193
// FIXME(#78546): MIR InstrumentCoverage - Can the source_info.span for `FakeRead`
@@ -211,30 +209,28 @@ fn filtered_statement_span(statement: &Statement<'_>) -> Option<Span> {
211
209
StatementKind :: FakeRead ( box ( FakeReadCause :: ForGuardBinding , _) ) => None ,
212
210
213
211
// Retain spans from most other statements.
214
- StatementKind :: FakeRead ( box ( _ , _ ) ) // Not including `ForGuardBinding`
212
+ StatementKind :: FakeRead ( _ )
215
213
| StatementKind :: Intrinsic ( ..)
216
- | StatementKind :: Coverage ( box mir :: Coverage {
214
+ | StatementKind :: Coverage (
217
215
// The purpose of `SpanMarker` is to be matched and accepted here.
218
- kind : CoverageKind :: SpanMarker
219
- } )
216
+ CoverageKind :: SpanMarker ,
217
+ )
220
218
| StatementKind :: Assign ( _)
221
219
| StatementKind :: SetDiscriminant { .. }
222
220
| StatementKind :: Deinit ( ..)
223
221
| StatementKind :: Retag ( _, _)
224
222
| StatementKind :: PlaceMention ( ..)
225
- | StatementKind :: AscribeUserType ( _, _) => {
226
- Some ( statement. source_info . span )
227
- }
223
+ | StatementKind :: AscribeUserType ( _, _) => Some ( statement. source_info . span ) ,
228
224
229
- StatementKind :: Coverage ( box mir:: Coverage {
230
- // Block markers are used for branch coverage, so ignore them here.
231
- kind : CoverageKind :: BlockMarker { ..}
232
- } ) => None ,
225
+ // Block markers are used for branch coverage, so ignore them here.
226
+ StatementKind :: Coverage ( CoverageKind :: BlockMarker { .. } ) => None ,
233
227
234
- StatementKind :: Coverage ( box mir:: Coverage {
235
- // These coverage statements should not exist prior to coverage instrumentation.
236
- kind : CoverageKind :: CounterIncrement { .. } | CoverageKind :: ExpressionUsed { .. }
237
- } ) => bug ! ( "Unexpected coverage statement found during coverage instrumentation: {statement:?}" ) ,
228
+ // These coverage statements should not exist prior to coverage instrumentation.
229
+ StatementKind :: Coverage (
230
+ CoverageKind :: CounterIncrement { .. } | CoverageKind :: ExpressionUsed { .. } ,
231
+ ) => bug ! (
232
+ "Unexpected coverage statement found during coverage instrumentation: {statement:?}"
233
+ ) ,
238
234
}
239
235
}
240
236
@@ -382,9 +378,7 @@ pub(super) fn extract_branch_mappings(
382
378
// Fill out the mapping from block marker IDs to their enclosing blocks.
383
379
for ( bb, data) in mir_body. basic_blocks . iter_enumerated ( ) {
384
380
for statement in & data. statements {
385
- if let StatementKind :: Coverage ( coverage) = & statement. kind
386
- && let CoverageKind :: BlockMarker { id } = coverage. kind
387
- {
381
+ if let StatementKind :: Coverage ( CoverageKind :: BlockMarker { id } ) = statement. kind {
388
382
block_markers[ id] = Some ( bb) ;
389
383
}
390
384
}
0 commit comments