Skip to content

Commit

Permalink
(> 1e6e3fb)remove useless &mut of extracted_mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuUx committed Jul 15, 2024
1 parent 1e6e3fb commit 97596dd
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions compiler/rustc_mir_transform/src/coverage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn instrument_function_for_coverage<'tcx>(tcx: TyCtxt<'tcx>, mir_body: &mut mir:

////////////////////////////////////////////////////
// Extract coverage spans and other mapping info from MIR.
let mut extracted_mappings = mappings::extract_all_mapping_info_from_mir(
let extracted_mappings = mappings::extract_all_mapping_info_from_mir(
tcx,
mir_body,
&hir_info,
Expand All @@ -103,7 +103,7 @@ fn instrument_function_for_coverage<'tcx>(tcx: TyCtxt<'tcx>, mir_body: &mut mir:
mir_body,
tcx,
&hir_info,
&mut extracted_mappings,
&extracted_mappings,
&basic_coverage_blocks,
&mut coverage_counters,
);
Expand Down Expand Up @@ -148,7 +148,7 @@ fn create_mappings<'tcx>(
mir_body: &mut mir::Body<'tcx>,
tcx: TyCtxt<'tcx>,
hir_info: &ExtractedHirInfo,
extracted_mappings: &mut ExtractedMappings,
extracted_mappings: &ExtractedMappings,
basic_coverage_blocks: &CoverageGraph,
coverage_counters: &mut CoverageCounters,
) -> Vec<Mapping> {
Expand Down Expand Up @@ -241,12 +241,7 @@ fn create_mappings<'tcx>(
let conditions = branches
.into_iter()
.filter_map(
|&mut mappings::MCDCBranch {
span,
ref true_bcbs,
ref false_bcbs,
condition_info,
}| {
|&mappings::MCDCBranch { span, ref true_bcbs, ref false_bcbs, condition_info }| {
let code_region = region_for_span(span)?;
let true_term = term_for_bcbs(true_bcbs);
let false_term = term_for_bcbs(false_bcbs);
Expand Down

0 comments on commit 97596dd

Please sign in to comment.