Skip to content

Commit

Permalink
coverage: Rename BcbBranchPair to mappings::BranchPair
Browse files Browse the repository at this point in the history
This makes it consistent with the other mapping structs introduced by this PR.
  • Loading branch information
Zalathar committed May 2, 2024
1 parent 7898c18 commit f27f60c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions compiler/rustc_mir_transform/src/coverage/mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(super) struct CodeMapping {
/// that will be needed for improved branch coverage in the future.
/// (See <https://github.com/rust-lang/rust/pull/124217>.)
#[derive(Debug)]
pub(super) struct BcbBranchPair {
pub(super) struct BranchPair {
pub(super) span: Span,
pub(super) true_bcb: BasicCoverageBlock,
pub(super) false_bcb: BasicCoverageBlock,
Expand Down Expand Up @@ -55,7 +55,7 @@ pub(super) struct MCDCDecision {
pub(super) struct CoverageSpans {
bcb_has_mappings: BitSet<BasicCoverageBlock>,
pub(super) code_mappings: Vec<CodeMapping>,
pub(super) branch_pairs: Vec<BcbBranchPair>,
pub(super) branch_pairs: Vec<BranchPair>,
test_vector_bitmap_bytes: u32,
pub(super) mcdc_branches: Vec<MCDCBranch>,
pub(super) mcdc_decisions: Vec<MCDCDecision>,
Expand Down Expand Up @@ -124,7 +124,7 @@ pub(super) fn generate_coverage_spans(
for &CodeMapping { span: _, bcb } in &code_mappings {
insert(bcb);
}
for &BcbBranchPair { true_bcb, false_bcb, .. } in &branch_pairs {
for &BranchPair { true_bcb, false_bcb, .. } in &branch_pairs {
insert(true_bcb);
insert(false_bcb);
}
Expand Down Expand Up @@ -183,7 +183,7 @@ pub(super) fn extract_branch_pairs(
mir_body: &mir::Body<'_>,
hir_info: &ExtractedHirInfo,
basic_coverage_blocks: &CoverageGraph,
) -> Vec<BcbBranchPair> {
) -> Vec<BranchPair> {
let Some(branch_info) = mir_body.coverage_branch_info.as_deref() else { return vec![] };

let block_markers = resolve_block_markers(branch_info, mir_body);
Expand All @@ -206,7 +206,7 @@ pub(super) fn extract_branch_pairs(
let true_bcb = bcb_from_marker(true_marker)?;
let false_bcb = bcb_from_marker(false_marker)?;

Some(BcbBranchPair { span, true_bcb, false_bcb })
Some(BranchPair { span, true_bcb, false_bcb })
})
.collect::<Vec<_>>()
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/coverage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod tests;

use self::counters::{CounterIncrementSite, CoverageCounters};
use self::graph::{BasicCoverageBlock, CoverageGraph};
use self::mappings::{BcbBranchPair, CoverageSpans};
use self::mappings::CoverageSpans;

use crate::MirPass;

Expand Down Expand Up @@ -159,7 +159,7 @@ fn create_mappings<'tcx>(
));

mappings.extend(coverage_spans.branch_pairs.iter().filter_map(
|&BcbBranchPair { span, true_bcb, false_bcb }| {
|&mappings::BranchPair { span, true_bcb, false_bcb }| {
let true_term = term_for_bcb(true_bcb);
let false_term = term_for_bcb(false_bcb);
let kind = MappingKind::Branch { true_term, false_term };
Expand Down

0 comments on commit f27f60c

Please sign in to comment.