Add -Z maximal-hir-to-mir-coverage flag#105286
Merged
bors merged 2 commits intorust-lang:masterfrom Dec 6, 2022
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
70dc0ef to
3bf7d88
Compare
cjgillot
reviewed
Dec 5, 2022
compiler/rustc_middle/src/lint.rs
Outdated
| if self.sess.opts.unstable_opts.maximal_hir_to_mir_coverage { | ||
| return id; | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
The name of this function does not hint any relationship to MIR. Could you prefer using this flag in rustc_mir_build?
There are only 2 places where it's used, with the same pattern. Refactoring them to a single maybe_create_source_scope that checks this option may be the better option.
Contributor
Author
There was a problem hiding this comment.
Just refactored as requested. I named the method maybe_new_source_scope for consistency with new_source_scope.
cjgillot
reviewed
Dec 5, 2022
Contributor
There was a problem hiding this comment.
Those 2 calls should go into maybe_new_source_scope.
Contributor
Author
There was a problem hiding this comment.
Ah yes I was just fixing this when you left his comment :-)
cecb35a to
cbe2687
Compare
…source_scope` method
cbe2687 to
d595884
Compare
cjgillot
reviewed
Dec 6, 2022
Contributor
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 6, 2022
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#104898 (Put all cached values into a central struct instead of just the stable hash) - rust-lang#105004 (Fix `emit_unused_delims_expr` ICE) - rust-lang#105174 (Suggest removing struct field from destructive binding only in shorthand scenario) - rust-lang#105250 (Replace usage of `ResumeTy` in async lowering with `Context`) - rust-lang#105286 (Add -Z maximal-hir-to-mir-coverage flag) - rust-lang#105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles) - rust-lang#105349 (Point at args in associated const fn pointers) - rust-lang#105362 (Cleanup macro-expanded code in `rustc_type_ir`) - rust-lang#105370 (Remove outdated syntax from trait alias pretty printing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Contributor
Author
|
willcrichton/flowistry@5eb8f45 Net -140 lines of code! Thanks @cjgillot!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new unstable flag
-Z maximal-hir-to-mir-coveragethat changes the behavior ofmaybe_lint_level_root_bounded, pursuant to a discussion on Zulip. 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 theSourceScopeLocalDatadata structures. This increase in granularity is useful for rustc consumers like 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.rshas been added to verify that this flag does not break anything.r? @cjgillot
cc @gavinleroy