Wrap write_mir_fn call in with_no_trimmed_paths!()

This commit is contained in:
bjorn3 2022-03-19 16:54:51 +01:00
parent 8afa50c482
commit 215905cdc8

View File

@ -26,7 +26,10 @@ pub(crate) fn codegen_fn<'tcx>(
let mir = tcx.instance_mir(instance.def);
let _mir_guard = crate::PrintOnPanic(|| {
let mut buf = Vec::new();
rustc_middle::mir::pretty::write_mir_fn(tcx, mir, &mut |_, _| Ok(()), &mut buf).unwrap();
with_no_trimmed_paths!({
rustc_middle::mir::pretty::write_mir_fn(tcx, mir, &mut |_, _| Ok(()), &mut buf)
.unwrap();
});
String::from_utf8_lossy(&buf).into_owned()
});