Graphviz output for rustc_mir

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.

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.

1 Like

Thanks, that helps a lot.