mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
c699b05306
Add -Z maximal-hir-to-mir-coverage flag This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible. A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything. r? `@cjgillot` cc `@gavinleroy` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |