Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
46c545c
coverage: Rename `check_invoked_macro_name_span` to `maybe_push_macro…
Zalathar Oct 16, 2023
9b6ce4f
coverage: Rename `check_pending_dups` to `maybe_flush_pending_dups`
Zalathar Oct 16, 2023
d928d3e
coverage: Rename `hold_pending_dups_unless_dominated` to `update_pend…
Zalathar Oct 15, 2023
fa2e262
coverage: Use `DUMMY_SP` instead of creating a dummy span manually
Zalathar Oct 15, 2023
5f1e8f9
coverage: Simplify `push_refined_span`
Zalathar Oct 14, 2023
97d1a91
coverage: Flatten guard logic in `maybe_push_macro_name_span`
Zalathar Oct 16, 2023
7bbe4be
coverage: Flatten guard logic in `maybe_flush_pending_dups`
Zalathar Oct 16, 2023
9bb27f3
coverage: Remove redundant field `prev_expn_span`
Zalathar Oct 15, 2023
b1c44f4
coverage: Call `prev`/`curr` less in `to_refined_spans`
Zalathar Oct 15, 2023
41038db
coverage: Call `prev`/`curr` less in other places
Zalathar Oct 15, 2023
25e6303
coverage: Move `take_curr` and note what its callers are doing
Zalathar Oct 15, 2023
4ab4273
coverage: Inline `prev_starts_after_next`
Zalathar Oct 14, 2023
5e5a8e7
coverage: Inline `span_bcb_dominates`
Zalathar Oct 15, 2023
7aa1b83
coverage: Explain why we temporarily steal `pending_dups`
Zalathar Oct 14, 2023
17ec3cd
Fix outlives suggestion for GAT in RPITIT
compiler-errors Oct 16, 2023
414135d
Make `rustc_onunimplemented` export path agnostic
Noratrieb Oct 16, 2023
5e6da1e
add myself to smir triage
ouz-a Oct 16, 2023
ad26a0b
Improve display of parallel jobs in rustdoc-gui tester script
GuillaumeGomez Oct 16, 2023
587899e
Preserve unicode escapes in format string literals when pretty-printi…
narpfel Oct 16, 2023
581f88d
Rollup merge of #116754 - Zalathar:spans, r=oli-obk
GuillaumeGomez Oct 16, 2023
4c1c8ab
Rollup merge of #116798 - GuillaumeGomez:rustdoc-gui-tester-cleanup, …
GuillaumeGomez Oct 16, 2023
d0ade3f
Rollup merge of #116800 - compiler-errors:rpitit-gat-outlives, r=jack…
GuillaumeGomez Oct 16, 2023
347f7f3
Rollup merge of #116805 - Nilstrieb:onunimplemented-std-core-alloc-wh…
GuillaumeGomez Oct 16, 2023
23000c3
Rollup merge of #116808 - ouz-a:add_myself_to_triage, r=Nilstrieb
GuillaumeGomez Oct 16, 2023
05e2056
Rollup merge of #116811 - narpfel:unpretty-unicode-escape-in-format-s…
GuillaumeGomez Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
coverage: Flatten guard logic in maybe_flush_pending_dups
  • Loading branch information
Zalathar committed Oct 16, 2023
commit 7bbe4be5685c7e3ba7bb72f921cee08f48db429d
31 changes: 16 additions & 15 deletions compiler/rustc_mir_transform/src/coverage/spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,22 +456,23 @@ impl<'a> CoverageSpansGenerator<'a> {
/// In either case, no more spans will match the span of `pending_dups`, so
/// add the `pending_dups` if they don't overlap `curr`, and clear the list.
fn maybe_flush_pending_dups(&mut self) {
if let Some(dup) = self.pending_dups.last()
&& dup.span != self.prev().span
{
debug!(
" SAME spans, but pending_dups are NOT THE SAME, so BCBs matched on \
previous iteration, or prev started a new disjoint span"
);
if dup.span.hi() <= self.curr().span.lo() {
let pending_dups = self.pending_dups.split_off(0);
for dup in pending_dups.into_iter() {
debug!(" ...adding at least one pending={:?}", dup);
self.push_refined_span(dup);
}
} else {
self.pending_dups.clear();
let Some(last_dup) = self.pending_dups.last() else { return };
if last_dup.span == self.prev().span {
return;
}

debug!(
" SAME spans, but pending_dups are NOT THE SAME, so BCBs matched on \
previous iteration, or prev started a new disjoint span"
);
if last_dup.span.hi() <= self.curr().span.lo() {
let pending_dups = self.pending_dups.split_off(0);
for dup in pending_dups.into_iter() {
debug!(" ...adding at least one pending={:?}", dup);
self.push_refined_span(dup);
}
} else {
self.pending_dups.clear();
}
}

Expand Down