rust/compiler/rustc_mir_transform/src/coverage
Matthias Krüger f4de82c2b3
Rollup merge of #116589 - Zalathar:successors, r=oli-obk
coverage: Unbox and simplify `bcb_filtered_successors`

This is a small cleanup in the coverage instrumentor's graph-building code.

---
This function already has access to the MIR body, so instead of taking a reference to a terminator, it's simpler and easier to pass in a basic block index.

There is no need to box the returned iterator if we instead add appropriate lifetime captures, and make `short_circuit_preorder` generic over the type of iterator it expects.

We can also greatly simplify the function's implementation by observing that the only difference between its two cases is whether we take all of a BB's successors, or just the first one.

---

`@rustbot` label +A-code-coverage
2023-10-10 14:07:47 +02:00
..
spans coverage: Remove enum CoverageStatement 2023-10-10 13:39:23 +11:00
test_macros inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
counters.rs coverage: Remove next_id methods from counter/expression IDs 2023-10-03 13:03:40 +11:00
graph.rs coverage: Unbox and simplify bcb_filtered_successors 2023-10-10 18:45:29 +11:00
mod.rs coverage: Remove code for making expression copies of BCB counters 2023-10-03 13:03:39 +11:00
query.rs coverage: Let each coverage statement hold a vector of code regions 2023-10-03 13:03:39 +11:00
spans.rs coverage: Remove enum CoverageStatement 2023-10-10 13:39:23 +11:00
tests.rs coverage: Unbox and simplify bcb_filtered_successors 2023-10-10 18:45:29 +11:00