Skip to content

Expand NLL MIR dumps - #129711

Merged
bors merged 5 commits into
rust-lang:masterfrom
lqd:nll-mir-dumps
Aug 31, 2024
Merged

bors merged 5 commits into
rust-lang:masterfrom
lqd:nll-mir-dumps

Conversation

@lqd

@lqd lqd commented Aug 28, 2024

Copy link
Copy Markdown
Member

This PR is a first step to clean up and expand NLL MIR dumps:

  • by restoring the "mir-include-spans" comments which are useful for -Zdump-mir=nll
  • by adding the list of borrows to NLL MIR dumps, where they are introduced in the CFG and in which region

Comments in MIR dumps were turned off in #112346, but as shown in #114652 they were still useful for us working with NLL MIR dumps. So this PR pulls -Z mir-include-spans into its own options struct, so that passes dumping MIR can override them if need be. The rest of the compiler is not affected, only the "nll" pass dumps have these comments enabled again. The CLI still has priority when specifying the flag, so that we can explicitly turn them off in the mir-opt tests to keep blessed dumps easier to work with (which was one of the points of #112346).

Then, as part of a couple steps to improve NLL/polonius MIR dumps and .dot visualizations, I've also added the list of borrows and where they're introduced. I'm doing all this to help debug some polonius scope issues in my prototype location-sensitive analysis :3. I'll probably add member constraints soon.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants