@@ -151,17 +151,26 @@ fn create_mappings<'tcx>(
151151 } ;
152152 let region_for_span = |span : Span | make_code_region ( source_map, file_name, span, body_span) ;
153153
154+ // Fully destructure the mappings struct to make sure we don't miss any kinds.
155+ let CoverageSpans {
156+ code_mappings,
157+ branch_pairs,
158+ mcdc_bitmap_bytes : _,
159+ mcdc_branches,
160+ mcdc_decisions,
161+ } = coverage_spans;
154162 let mut mappings = Vec :: new ( ) ;
155163
156- mappings. extend ( coverage_spans. code_mappings . iter ( ) . filter_map (
164+ mappings. extend ( code_mappings. iter ( ) . filter_map (
165+ // Ordinary code mappings are the simplest kind.
157166 |& mappings:: CodeMapping { span, bcb } | {
158167 let code_region = region_for_span ( span) ?;
159168 let kind = MappingKind :: Code ( term_for_bcb ( bcb) ) ;
160169 Some ( Mapping { kind, code_region } )
161170 } ,
162171 ) ) ;
163172
164- mappings. extend ( coverage_spans . branch_pairs . iter ( ) . filter_map (
173+ mappings. extend ( branch_pairs. iter ( ) . filter_map (
165174 |& mappings:: BranchPair { span, true_bcb, false_bcb } | {
166175 let true_term = term_for_bcb ( true_bcb) ;
167176 let false_term = term_for_bcb ( false_bcb) ;
@@ -171,7 +180,7 @@ fn create_mappings<'tcx>(
171180 } ,
172181 ) ) ;
173182
174- mappings. extend ( coverage_spans . mcdc_branches . iter ( ) . filter_map (
183+ mappings. extend ( mcdc_branches. iter ( ) . filter_map (
175184 |& mappings:: MCDCBranch { span, true_bcb, false_bcb, condition_info, decision_depth : _ } | {
176185 let code_region = region_for_span ( span) ?;
177186 let true_term = term_for_bcb ( true_bcb) ;
@@ -184,7 +193,7 @@ fn create_mappings<'tcx>(
184193 } ,
185194 ) ) ;
186195
187- mappings. extend ( coverage_spans . mcdc_decisions . iter ( ) . filter_map (
196+ mappings. extend ( mcdc_decisions. iter ( ) . filter_map (
188197 |& mappings:: MCDCDecision { span, bitmap_idx, conditions_num, .. } | {
189198 let code_region = region_for_span ( span) ?;
190199 let kind = MappingKind :: MCDCDecision ( DecisionInfo { bitmap_idx, conditions_num } ) ;
0 commit comments