diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-17 10:51:35 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-17 10:51:35 +1100 |
| commit | 7b1ac28f1c235ec5cd25bb0cd42014fdc95a5b46 (patch) | |
| tree | d1fe7a87780e9f6397ea1a9ed76ed60f41286bee /src/lib.rs | |
| parent | 5a12a899926cb2ead9bf7b18690e99fa21b51e55 (diff) | |
Make `CodegenBackend::join_codegen` infallible.
Because they all are, in practice.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index 863b6333bcc..09ce059476e 100644 --- a/src/lib.rs +++ b/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> { |
