previous thir unpretty output through thir-flat

This commit is contained in:
b-naber 2023-01-26 23:35:24 +01:00
parent 3bce66f786
commit 9438126fd1
5 changed files with 38 additions and 3 deletions

View file

@ -498,6 +498,21 @@ fn print_with_analysis(tcx: TyCtxt<'_>, ppm: PpMode) -> Result<(), ErrorGuarante
out
}
ThirFlat => {
let mut out = String::new();
abort_on_err(rustc_hir_analysis::check_crate(tcx), tcx.sess);
debug!("pretty printing THIR flat");
for did in tcx.hir().body_owners() {
let _ = writeln!(
out,
"{:?}:\n{}\n",
did,
tcx.thir_flat(ty::WithOptConstParam::unknown(did))
);
}
out
}
_ => unreachable!(),
};