about summary refs log tree commit diff
path: root/compiler/rustc_driver/src
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2023-01-26 23:35:24 +0100
committerb-naber <bn263@gmx.de>2023-01-26 23:39:57 +0100
commit9438126fd12a57fe065cbfe35a952024a7d8e4c0 (patch)
tree28615d1272f9091828ea8340e6fcc7ad4db84e9f /compiler/rustc_driver/src
parent3bce66f786685b74fbeb7eae53ccf6283fded994 (diff)
downloadrust-9438126fd12a57fe065cbfe35a952024a7d8e4c0.tar.gz
rust-9438126fd12a57fe065cbfe35a952024a7d8e4c0.zip
previous thir unpretty output through thir-flat
Diffstat (limited to 'compiler/rustc_driver/src')
-rw-r--r--compiler/rustc_driver/src/pretty.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_driver/src/pretty.rs b/compiler/rustc_driver/src/pretty.rs
index ae3ac8625b1..a7c040397a1 100644
--- a/compiler/rustc_driver/src/pretty.rs
+++ b/compiler/rustc_driver/src/pretty.rs
@@ -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!(),
     };