Add comment explaining why we flush delayed bugs before codegen

This commit is contained in:
nils 2022-09-30 14:11:18 +02:00 committed by GitHub
parent 8a96884981
commit 477846f491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,6 +246,8 @@ pub fn ongoing_codegen(&'tcx self) -> Result<&Query<Box<dyn Any>>> {
// 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.