1
Fork 0

Support -Z unpretty=thir-tree again

This commit is contained in:
Smitty 2021-07-24 17:18:15 -04:00
parent bddb59cf07
commit e8165e7f1b
6 changed files with 29 additions and 3 deletions

View file

@ -30,4 +30,5 @@ pub fn provide(providers: &mut Providers) {
providers.thir_check_unsafety = check_unsafety::thir_check_unsafety;
providers.thir_check_unsafety_for_const_arg = check_unsafety::thir_check_unsafety_for_const_arg;
providers.thir_body = thir::cx::thir_body;
providers.thir_tree = thir::cx::thir_tree;
}

View file

@ -30,6 +30,13 @@ crate fn thir_body<'tcx>(
(tcx.alloc_steal_thir(cx.thir), expr)
}
crate fn thir_tree<'tcx>(
tcx: TyCtxt<'tcx>,
owner_def: ty::WithOptConstParam<LocalDefId>,
) -> String {
format!("{:#?}", thir_body(tcx, owner_def).0.steal())
}
struct Cx<'tcx> {
tcx: TyCtxt<'tcx>,
thir: Thir<'tcx>,