Graphviz output for rustc_mir


#1

According to this reddit post it is possible to generate the mir representation with the nightly toolchain.

#![feature(rustc_attrs)]

#[rustc_mir(graphviz = "basic.dot")]
fn foo() {...}

However when I try it myself there is no file written by rustc.


#2

That was removed in https://github.com/rust-lang/rust/pull/31916. You can use --unpretty mir-cfg, --unpretty mir, or just click the MIR button in the playpen.


#3

Thanks, that helps a lot.