about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-08 14:44:10 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-08 14:44:10 +0000
commit3b16ee25684a88247b32ef32e38c119aeb043dc4 (patch)
tree3121a1542af9722ef5f7a49125e52133982c5bd8 /compiler/rustc_driver_impl/src
parent0e5f5207881066973486e6a480fa46cfa22947e9 (diff)
downloadrust-3b16ee25684a88247b32ef32e38c119aeb043dc4.tar.gz
rust-3b16ee25684a88247b32ef32e38c119aeb043dc4.zip
Ensure we do not accidentally insert new early aborts in the analysis passes
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/pretty.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_driver_impl/src/pretty.rs b/compiler/rustc_driver_impl/src/pretty.rs
index c9bbe45b212..c0c6201f73d 100644
--- a/compiler/rustc_driver_impl/src/pretty.rs
+++ b/compiler/rustc_driver_impl/src/pretty.rs
@@ -336,7 +336,8 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
         ThirTree => {
             let tcx = ex.tcx();
             let mut out = String::new();
-            if rustc_hir_analysis::check_crate(tcx).is_err() {
+            rustc_hir_analysis::check_crate(tcx);
+            if tcx.dcx().has_errors().is_some() {
                 FatalError.raise();
             }
             debug!("pretty printing THIR tree");
@@ -348,7 +349,8 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
         ThirFlat => {
             let tcx = ex.tcx();
             let mut out = String::new();
-            if rustc_hir_analysis::check_crate(tcx).is_err() {
+            rustc_hir_analysis::check_crate(tcx);
+            if tcx.dcx().has_errors().is_some() {
                 FatalError.raise();
             }
             debug!("pretty printing THIR flat");