diff options
| author | Ralf Jung <post@ralfj.de> | 2021-01-24 12:12:08 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2021-01-30 12:29:57 +0100 |
| commit | 944237f6cd2b7e732b6875bf0956bf323cc3316b (patch) | |
| tree | bc1c64c18793c4bdce42bd022ca6026cb9e02b2a /compiler/rustc_codegen_ssa/src/base.rs | |
| parent | 4d0dd02ee07bddad9136f95c9f7846ebf3eb3fc5 (diff) | |
| download | rust-944237f6cd2b7e732b6875bf0956bf323cc3316b.tar.gz rust-944237f6cd2b7e732b6875bf0956bf323cc3316b.zip | |
codegen: assume constants cannot fail to evaluate
also don't submit code to LLVM when the session has errors
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/base.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 2ce5fe5ad50..5cb0b03a4ba 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -625,6 +625,11 @@ pub fn codegen_crate<B: ExtraBackendMethods>( *time += start_time.elapsed(); module }; + // This will unwind if there are errors, which triggers our `AbortCodegenOnDrop` + // guard. Unfortunately, just skipping the `submit_codegened_module_to_llvm` makes + // compilation hang on post-monomorphization errors. + tcx.sess.abort_if_errors(); + submit_codegened_module_to_llvm( &backend, &ongoing_codegen.coordinator_send, |
