Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f7bfcbd

Browse files
committedMay 2, 2024·
coverage: Rename BcbBranchPair to mappings::BranchPair
This makes it consistent with the other mapping structs introduced by this PR.
1 parent 393fb1f commit f7bfcbd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎compiler/rustc_mir_transform/src/coverage/mappings.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(super) struct CodeMapping {
2424
/// that will be needed for improved branch coverage in the future.
2525
/// (See <https://github.com/rust-lang/rust/pull/124217>.)
2626
#[derive(Debug)]
27-
pub(super) struct BcbBranchPair {
27+
pub(super) struct BranchPair {
2828
pub(super) span: Span,
2929
pub(super) true_bcb: BasicCoverageBlock,
3030
pub(super) false_bcb: BasicCoverageBlock,
@@ -55,7 +55,7 @@ pub(super) struct MCDCDecision {
5555
pub(super) struct CoverageSpans {
5656
bcb_has_mappings: BitSet<BasicCoverageBlock>,
5757
pub(super) code_mappings: Vec<CodeMapping>,
58-
pub(super) branch_pairs: Vec<BcbBranchPair>,
58+
pub(super) branch_pairs: Vec<BranchPair>,
5959
test_vector_bitmap_bytes: u32,
6060
pub(super) mcdc_branches: Vec<MCDCBranch>,
6161
pub(super) mcdc_decisions: Vec<MCDCDecision>,
@@ -124,7 +124,7 @@ pub(super) fn generate_coverage_spans(
124124
for &CodeMapping { span: _, bcb } in &code_mappings {
125125
insert(bcb);
126126
}
127-
for &BcbBranchPair { true_bcb, false_bcb, .. } in &branch_pairs {
127+
for &BranchPair { true_bcb, false_bcb, .. } in &branch_pairs {
128128
insert(true_bcb);
129129
insert(false_bcb);
130130
}
@@ -183,7 +183,7 @@ pub(super) fn extract_branch_pairs(
183183
mir_body: &mir::Body<'_>,
184184
hir_info: &ExtractedHirInfo,
185185
basic_coverage_blocks: &CoverageGraph,
186-
) -> Vec<BcbBranchPair> {
186+
) -> Vec<BranchPair> {
187187
let Some(branch_info) = mir_body.coverage_branch_info.as_deref() else { return vec![] };
188188

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

209-
Some(BcbBranchPair { span, true_bcb, false_bcb })
209+
Some(BranchPair { span, true_bcb, false_bcb })
210210
})
211211
.collect::<Vec<_>>()
212212
}

‎compiler/rustc_mir_transform/src/coverage/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod tests;
99

1010
use self::counters::{CounterIncrementSite, CoverageCounters};
1111
use self::graph::{BasicCoverageBlock, CoverageGraph};
12-
use self::mappings::{BcbBranchPair, CoverageSpans};
12+
use self::mappings::CoverageSpans;
1313

1414
use crate::MirPass;
1515

@@ -159,7 +159,7 @@ fn create_mappings<'tcx>(
159159
));
160160

161161
mappings.extend(coverage_spans.branch_pairs.iter().filter_map(
162-
|&BcbBranchPair { span, true_bcb, false_bcb }| {
162+
|&mappings::BranchPair { span, true_bcb, false_bcb }| {
163163
let true_term = term_for_bcb(true_bcb);
164164
let false_term = term_for_bcb(false_bcb);
165165
let kind = MappingKind::Branch { true_term, false_term };

0 commit comments

Comments
 (0)
Please sign in to comment.