Rollup merge of #107006 - b-naber:thir-tree, r=jackh726
Output tree representation on thir-tree The current output of `-Zunpretty=thir-tree` is really cumbersome to work with, using an actual tree representation should make it easier to see what the thir looks like.
This commit is contained in:
commit
45446824e3
14 changed files with 1345 additions and 9 deletions
|
@ -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!(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue