Skip to content

Commit

Permalink
introduce PrettyPrintMirOptions for cosmetic MIR dump options
Browse files Browse the repository at this point in the history
initially starting with `-Z mir-include-spans` because we want them in
the NLL mir dump pass
  • Loading branch information
lqd committed Aug 30, 2024
1 parent 8a26d21 commit 0fba9b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ pub(crate) fn codegen_fn<'tcx>(
let _mir_guard = crate::PrintOnPanic(|| {
let mut buf = Vec::new();
with_no_trimmed_paths!({
rustc_middle::mir::pretty::write_mir_fn(tcx, mir, &mut |_, _| Ok(()), &mut buf)
.unwrap();
use rustc_middle::mir::pretty;
let options = pretty::PrettyPrintMirOptions::from_cli(tcx);
pretty::write_mir_fn(tcx, mir, &mut |_, _| Ok(()), &mut buf, options).unwrap();
});
String::from_utf8_lossy(&buf).into_owned()
});
Expand Down

0 comments on commit 0fba9b4

Please sign in to comment.