Rollup merge of #137671 - meithecatte:discoverable-dump-mir, r=Nadrieril

Make -Z unpretty=mir suggest -Z dump-mir as well for discoverability

While debugging something else, I got quite annoyed with `-Z unpretty=mir` showing me post-processed MIR instead of the one just after it is built. I ended up asking on Zulip and got pointed to `-Z dump-mir`. While this feature is documented in the rustc dev guide, I think it'd be good if the possibility of making use of it was staring you in the face while you need it.
This commit is contained in:
León Orell Valerian Liehr 2025-02-26 19:03:59 +01:00 committed by GitHub
commit 46eb43e71b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -319,6 +319,7 @@ pub fn write_mir_pretty<'tcx>(
writeln!(w, "// WARNING: This output format is intended for human consumers only")?;
writeln!(w, "// and is subject to change without notice. Knock yourself out.")?;
writeln!(w, "// HINT: See also -Z dump-mir for MIR at specific points during compilation.")?;
let mut first = true;
for def_id in dump_mir_def_ids(tcx, single) {

View File

@ -1,5 +1,6 @@
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
// HINT: See also -Z dump-mir for MIR at specific points during compilation.
fn foo() -> i32 {
let mut _0: i32;
let mut _1: (i32, bool);