diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-06 16:54:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-06 16:54:55 +0100 |
| commit | c699b0530604105d0ceaa391453b89765ddfb75d (patch) | |
| tree | 4e776903974848b06ab2c92b093abb1ed1475dbb /compiler/rustc_interface/src | |
| parent | 967085ecdf589ec92f528c71cfb9ace723cbabb1 (diff) | |
| parent | d595884302240f07576239288c771b0e9717fc19 (diff) | |
| download | rust-c699b0530604105d0ceaa391453b89765ddfb75d.tar.gz rust-c699b0530604105d0ceaa391453b89765ddfb75d.zip | |
Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot
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`
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index a6205f4d3a5..2b8f6557c82 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -747,6 +747,7 @@ fn test_unstable_options_tracking_hash() { tracked!(link_only, true); tracked!(llvm_plugins, vec![String::from("plugin_name")]); tracked!(location_detail, LocationDetail { file: true, line: false, column: false }); + tracked!(maximal_hir_to_mir_coverage, true); tracked!(merge_functions, Some(MergeFunctions::Disabled)); tracked!(mir_emit_retag, true); tracked!(mir_enable_passes, vec![("DestProp".to_string(), false)]); |
