previous thir unpretty output through thir-flat
This commit is contained in:
parent
3bce66f786
commit
9438126fd1
5 changed files with 38 additions and 3 deletions
|
@ -34,4 +34,5 @@ pub fn provide(providers: &mut Providers) {
|
|||
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;
|
||||
providers.thir_flat = thir::cx::thir_flat;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,13 @@ pub(crate) fn thir_tree(tcx: TyCtxt<'_>, owner_def: ty::WithOptConstParam<LocalD
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn thir_flat(tcx: TyCtxt<'_>, owner_def: ty::WithOptConstParam<LocalDefId>) -> String {
|
||||
match thir_body(tcx, owner_def) {
|
||||
Ok((thir, _)) => format!("{:#?}", thir.steal()),
|
||||
Err(_) => "error".into(),
|
||||
}
|
||||
}
|
||||
|
||||
struct Cx<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
thir: Thir<'tcx>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue