mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-04 12:11:58 +00:00
coverage: Arrange span extraction/refinement as a series of passes The old code for extracting/refining coverage spans from MIR has been dismantled and split up into several passes (e.g. see #126294), but because this was done incrementally, the resulting code is disorganised. This PR addresses that by moving the main control-flow into a single function (`coverage::spans::extract_refined_covspans`) that more clearly shows the process as a series of separate steps, most delegated to helper functions in the same file. This should make it easier to understand and modify the refinement process. It also means that submodule `from_mir` is now only concerned with the details of extracting relevant spans from the various kinds of MIR statement/terminator. There should be no change to the resulting coverage maps, as demonstrated by the lack of changes to tests.