Skip to content

-Zunpretty=mir-cfg generates invalid dot syntax #66985

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
osa1 opened this issue Dec 3, 2019 · 0 comments · Fixed by #66988
Closed

-Zunpretty=mir-cfg generates invalid dot syntax #66985

osa1 opened this issue Dec 3, 2019 · 0 comments · Fixed by #66988
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@osa1
Copy link
Contributor

osa1 commented Dec 3, 2019

Program:

fn f(arg: (u8)) {}
fn main() { f((0)) }

Build with -Zunpretty=mir-cfg:

$ /home/omer/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc -Zunpretty=mir-cfg test.rs > test.dot

Generated .dot file is not valid:

$ dot -Tpng test.dot > test.png
Error: test.dot: syntax error in line 15 near '>'

File contents:

digraph __crate__ {
subgraph cluster_Mir_0_4 {
    graph [fontname="monospace"];
    node [fontname="monospace"];
    edge [fontname="monospace"];
    label=<fn main() -&gt; ()<br align="left"/>>;
    bb0__0_4 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left">_0 = const f(const 0u8)</td></tr></table>>];
    bb1__0_4 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">return</td></tr></table>>];
    bb0__0_4 -> bb1__0_4 [label="return"];
}
subgraph cluster_Mir_0_3 {
    graph [fontname="monospace"];
    node [fontname="monospace"];
    edge [fontname="monospace"];
    label=<fn f(_1: u8) -&gt; ()<br align="left"/>debug arg => _1;<br align="left"/>>;
    bb0__0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left">return</td></tr></table>>];
}
}
@jonas-schievink jonas-schievink added A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 3, 2019
JohnTitor added a commit to JohnTitor/rust that referenced this issue Dec 6, 2019
Fix angle bracket formatting when dumping MIR debug vars

Fixes rust-lang#66985
@bors bors closed this as completed in b85d5f4 Dec 6, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing (including `-Z unpretty`) C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants