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: Remove redundant field prev_expn_span
This span can always be retrieved from `prev`, so there is no need to store it
separately.
  • Loading branch information
Zalathar committed Oct 16, 2023
commit 9bb27f3adfe1df21d1c85b96aaf75f0b349d3ab4
9 changes: 2 additions & 7 deletions compiler/rustc_mir_transform/src/coverage/spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ struct CoverageSpansGenerator<'a> {
/// is mutated.
prev_original_span: Span,

/// A copy of the expn_span from the prior iteration.
prev_expn_span: Option<Span>,

/// One or more `CoverageSpan`s with the same `Span` but different `BasicCoverageBlock`s, and
/// no `BasicCoverageBlock` in this list dominates another `BasicCoverageBlock` in the list.
/// If a new `curr` span also fits this criteria (compared to an existing list of
Expand Down Expand Up @@ -276,7 +273,6 @@ impl<'a> CoverageSpansGenerator<'a> {
curr_original_span: DUMMY_SP,
some_prev: None,
prev_original_span: DUMMY_SP,
prev_expn_span: None,
pending_dups: Vec::new(),
refined_spans: Vec::with_capacity(basic_coverage_blocks.num_nodes() * 2),
};
Expand Down Expand Up @@ -399,8 +395,8 @@ impl<'a> CoverageSpansGenerator<'a> {
/// span that ends just after the macro name and its subsequent `!`.
fn maybe_push_macro_name_span(&mut self) {
let Some(visible_macro) = self.curr().visible_macro(self.body_span) else { return };
if let Some(prev_expn_span) = &self.prev_expn_span
&& prev_expn_span.ctxt() == self.curr().expn_span.ctxt()
if let Some(prev) = &self.some_prev
&& prev.expn_span.ctxt() == self.curr().expn_span.ctxt()
{
return;
}
Expand Down Expand Up @@ -479,7 +475,6 @@ impl<'a> CoverageSpansGenerator<'a> {
/// Advance `prev` to `curr` (if any), and `curr` to the next `CoverageSpan` in sorted order.
fn next_coverage_span(&mut self) -> bool {
if let Some(curr) = self.some_curr.take() {
self.prev_expn_span = Some(curr.expn_span);
self.some_prev = Some(curr);
self.prev_original_span = self.curr_original_span;
}
Expand Down