Skip to content

borrowck_graphviz_* attribute tweaks #139886

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

Merged
merged 2 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_mir_dataflow/src/framework/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl RustcMirAttrs {
})
} else if attr.has_name(sym::borrowck_graphviz_format) {
Self::set_field(&mut ret.formatter, tcx, &attr, |s| match s {
sym::gen_kill | sym::two_phase => Ok(s),
sym::two_phase => Ok(s),
_ => {
tcx.dcx().emit_err(UnknownFormatter { span: attr.span() });
Err(())
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ symbols! {
ge,
gen_blocks,
gen_future,
gen_kill,
generator_clone,
generators,
generic_arg_infer,
Expand Down
3 changes: 2 additions & 1 deletion src/doc/rustc-dev-guide/src/compiler-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ Right below you can find elaborate explainers on a selected few.

Some compiler options for debugging specific features yield graphviz graphs -
e.g. the `#[rustc_mir(borrowck_graphviz_postflow="suffix.dot")]` attribute
dumps various borrow-checker dataflow graphs.
on a function dumps various borrow-checker dataflow graphs in conjunction with
`-Zdump-mir-dataflow`.

These all produce `.dot` files. To view these files, install graphviz (e.g.
`apt-get install graphviz`) and then run the following commands:
Expand Down
9 changes: 0 additions & 9 deletions tests/ui/mir-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,3 @@ each generated output path.
on *entry* to each block, as well as the gen- and kill-sets that
were so-called "transfer functions" summarizing the effect of each
basic block.

* (In addition to the `borrowck_graphviz_postflow` attribute-key
noted above, there is also `borrowck_graphviz_preflow`; it has the
same interface and generates the same set of files, but it renders
the dataflow state after building the gen- and kill-sets but
*before* running the dataflow analysis itself, so each entry-set is
just the initial default state for that dataflow analysis. This is
less useful for understanding the error message output in these
tests.)
Loading