From 477846f491284973f1f3f8b4bf9c6d9deb6ad98e Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 30 Sep 2022 14:11:18 +0200 Subject: [PATCH] Add comment explaining why we flush delayed bugs before codegen --- compiler/rustc_interface/src/queries.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 60ed48d8988..05775f37647 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -246,6 +246,8 @@ pub fn ongoing_codegen(&'tcx self) -> Result<&Query>> { // Don't do code generation if there were any errors self.session().compile_status()?; + // If we have any delayed bugs, for example beacuse we created TyKind::Error earlier, + // it's likey that codegen will only cause more ICEs, obscuring the original problem self.session().diagnostic().flush_delayed(); // Hook for UI tests.