Support -Z unpretty=thir-tree again
This commit is contained in:
parent
bddb59cf07
commit
e8165e7f1b
6 changed files with 29 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue