]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/thir/cx/mod.rs
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / compiler / rustc_mir_build / src / thir / cx / mod.rs
index a355e1bdab5f51c78d865660833d0faafe83e33a..10df4b229520f3bd1f8f572353b994cb14ae273e 100644 (file)
@@ -53,6 +53,16 @@ pub(crate) fn thir_body(
 }
 
 pub(crate) fn thir_tree(tcx: TyCtxt<'_>, owner_def: ty::WithOptConstParam<LocalDefId>) -> String {
+    match thir_body(tcx, owner_def) {
+        Ok((thir, _)) => {
+            let thir = thir.steal();
+            tcx.thir_tree_representation(&thir)
+        }
+        Err(_) => "error".into(),
+    }
+}
+
+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(),