-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand polonius MIR dump #136031
Expand polonius MIR dump #136031
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me unless you want a specific review from matthewjasper
/// That being said, if the above requirements have been validated already, this function is where | ||
/// most of the MIR dumping occurs, if one needs to export it to a file they have created with | ||
/// [create_dump_file], rather than to a new file created as part of [dump_mir]. | ||
pub fn dump_mir_to_writer<'tcx, F>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've wanted this so I could dump MIR to stderr :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn I’ve also wanted that before, I’ll actually add it to the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks for the review, Michael! In this case it was also to keep Matthew updated on the work, have his feedback in case he has opinions or ideas about debugging borrowck issues and how to support it better, but there’s no need to block on that yet and a ping also works. We can iterate later easily. I’ll r=you once I’ve updated the comment. |
for cases where we want to dump the MIR to a given writer instead of a new file as the default does. this will be used when dumping the MIR to a buffer to process differently, e.g. post-process to escape for an HTML dump.
escape the regular raw MIR into its own section
f686d39
to
09fb70a
Compare
@bors r=compiler-errors |
…=compiler-errors Expand polonius MIR dump This PR starts expanding the polonius MIR: - switches to an HTML file, to show graphs in the same document as the MIR dump, share them more easily since it's a single file that can be hosted as a gist, and also to allow for interactivity in the near future. - adds the regular NLL MIR + polonius constraints - embeds a mermaid version of the CFG, similar to the graphviz one, but that needs a smaller js than `dot`'s emscripten js from graphvizonline [Here's an example](https://gistpreview.github.io/?0c18f2a59b5e24ac0f96447aa34ffe00) of how it looks. --- In future PRs: mermaid graphs of the NLL region graph, of the NLL SCCs, of the polonius localized outlives constraints, and the interactive polonius MIR dump. r? `@matthewjasper`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only)) - rust-lang#133951 (Make the wasm_c_abi future compat warning a hard error) - rust-lang#134283 (fix(libtest): Deprecate '--logfile') - rust-lang#134679 (Windows: remove readonly files) - rust-lang#135635 (Move `std::io::pipe` code into its own file) - rust-lang#135842 (TRPL: more backward-compatible Edition changes) - rust-lang#135953 (ci.py: check the return code in `run-local`) - rust-lang#136031 (Expand polonius MIR dump) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#133631 (Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only)) - rust-lang#133951 (Make the wasm_c_abi future compat warning a hard error) - rust-lang#134283 (fix(libtest): Deprecate '--logfile') - rust-lang#134679 (Windows: remove readonly files) - rust-lang#135635 (Move `std::io::pipe` code into its own file) - rust-lang#135842 (TRPL: more backward-compatible Edition changes) - rust-lang#135953 (ci.py: check the return code in `run-local`) - rust-lang#136031 (Expand polonius MIR dump) r? `@ghost` `@rustbot` modify labels: rollup
…=compiler-errors Expand polonius MIR dump This PR starts expanding the polonius MIR: - switches to an HTML file, to show graphs in the same document as the MIR dump, share them more easily since it's a single file that can be hosted as a gist, and also to allow for interactivity in the near future. - adds the regular NLL MIR + polonius constraints - embeds a mermaid version of the CFG, similar to the graphviz one, but that needs a smaller js than `dot`'s emscripten js from graphvizonline [Here's an example](https://gistpreview.github.io/?0c18f2a59b5e24ac0f96447aa34ffe00) of how it looks. --- In future PRs: mermaid graphs of the NLL region graph, of the NLL SCCs, of the polonius localized outlives constraints, and the interactive polonius MIR dump. r? ``@matthewjasper``
Rollup of 7 pull requests Successful merges: - rust-lang#133951 (Make the wasm_c_abi future compat warning a hard error) - rust-lang#134283 (fix(libtest): Deprecate '--logfile') - rust-lang#135785 (use `PassMode::Direct` for vector types on `s390x`) - rust-lang#135948 (Update emscripten std tests) - rust-lang#135951 (Use `fmt::from_fn` in more places in the compiler) - rust-lang#136031 (Expand polonius MIR dump) - rust-lang#136032 (Account for mutable borrow in argument suggestion) Failed merges: - rust-lang#135635 (Move `std::io::pipe` code into its own file) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136031 - lqd:polonius-debugger-episode-1, r=compiler-errors Expand polonius MIR dump This PR starts expanding the polonius MIR: - switches to an HTML file, to show graphs in the same document as the MIR dump, share them more easily since it's a single file that can be hosted as a gist, and also to allow for interactivity in the near future. - adds the regular NLL MIR + polonius constraints - embeds a mermaid version of the CFG, similar to the graphviz one, but that needs a smaller js than `dot`'s emscripten js from graphvizonline [Here's an example](https://gistpreview.github.io/?0c18f2a59b5e24ac0f96447aa34ffe00) of how it looks. --- In future PRs: mermaid graphs of the NLL region graph, of the NLL SCCs, of the polonius localized outlives constraints, and the interactive polonius MIR dump. r? ```@matthewjasper```
This PR starts expanding the polonius MIR:
dot
's emscripten js from graphvizonlineHere's an example of how it looks.
In future PRs: mermaid graphs of the NLL region graph, of the NLL SCCs, of the polonius localized outlives constraints, and the interactive polonius MIR dump.
r? @matthewjasper