diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-17 18:47:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-17 18:47:42 +0100 |
| commit | a387b71b0cd202150b9d9eaa16041b57ef3c8b23 (patch) | |
| tree | 389b55bc90b2b8633cca82a7a2038d4c99744474 /compiler/rustc_codegen_gcc | |
| parent | df3712ce21311bb40b8e446f89c126509821ca4d (diff) | |
| parent | ede99234c48c120b909990ee2ee51dd87cfed6f5 (diff) | |
| download | rust-a387b71b0cd202150b9d9eaa16041b57ef3c8b23.tar.gz rust-a387b71b0cd202150b9d9eaa16041b57ef3c8b23.zip | |
Rollup merge of #121209 - nnethercote:infallible-join_codegen, r=bjorn3
Make `CodegenBackend::join_codegen` infallible. Because they all are, in practice. r? ```@bjorn3```
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs index 863b6333bcc..09ce059476e 100644 --- a/compiler/rustc_codegen_gcc/src/lib.rs +++ b/compiler/rustc_codegen_gcc/src/lib.rs @@ -217,13 +217,11 @@ impl CodegenBackend for GccCodegenBackend { Box::new(res) } - fn join_codegen(&self, ongoing_codegen: Box<dyn Any>, sess: &Session, _outputs: &OutputFilenames) -> Result<(CodegenResults, FxIndexMap<WorkProductId, WorkProduct>), ErrorGuaranteed> { - let (codegen_results, work_products) = ongoing_codegen + fn join_codegen(&self, ongoing_codegen: Box<dyn Any>, sess: &Session, _outputs: &OutputFilenames) -> (CodegenResults, FxIndexMap<WorkProductId, WorkProduct>) { + ongoing_codegen .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>() .expect("Expected GccCodegenBackend's OngoingCodegen, found Box<Any>") - .join(sess); - - Ok((codegen_results, work_products)) + .join(sess) } fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) -> Result<(), ErrorGuaranteed> { |
