diff options
| author | bors <bors@rust-lang.org> | 2019-11-01 03:15:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-11-01 03:15:31 +0000 |
| commit | 472e6787f03f19c1c2bd1736459d497aacc38a81 (patch) | |
| tree | 7aad04a70863c24045afe9e670afeafb47eb39f9 /src/liballoc/string.rs | |
| parent | aa4e57ca8f18b836bf77923cd0d9ad1390f0110b (diff) | |
| parent | cd3e9c4815c145e2458021ea0ee259dea7b3578c (diff) | |
| download | rust-472e6787f03f19c1c2bd1736459d497aacc38a81.tar.gz rust-472e6787f03f19c1c2bd1736459d497aacc38a81.zip | |
Auto merge of #65459 - ecstatic-morse:graphviz-subgraph, r=estebank
Fix `-Zunpretty=mir-cfg` to render multiple items `-Zunpretty=mir-cfg` outputs DOT to stdout for all items being compiled. However, it puts all of these items in separate `digraph`s, which means the result of redirecting that output to a file is not valid. Most dot renderers (I have tried `dot` and `xdot`) cannot render the output. This PR checks to see if `write_mir_graphviz` will process multiple items, and writes them each as a `subgraph` in a single, top-level `digraph`. As a result, DOT can be viewed without manually editing the output file. The output is unchanged when printing a single item (e.g.`-Zunpretty=mir-cfg=item_name`). Here's the output of `xdot` for a rust file containing three items:  The borders are a result of the nonstandard–but well-supported–[`cluster` prefix](https://graphviz.gitlab.io/_pages/doc/info/lang.html) (search for "Subgraphs and Clusters"). They will not appear if your renderer does not support this extension, but the graph will still render properly.
Diffstat (limited to 'src/liballoc/string.rs')
0 files changed, 0 insertions, 0 deletions
