introduce PrettyPrintMirOptions
for cosmetic MIR dump options
initially starting with `-Z mir-include-spans` because we want them in the NLL mir dump pass
This commit is contained in:
parent
0d634185df
commit
c646b46b52
2 changed files with 92 additions and 29 deletions
|
@ -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()
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue