Skip to content

Commit

Permalink
Make CodegenBackend::join_codegen infallible.
Browse files Browse the repository at this point in the history
Because they all are, in practice.
  • Loading branch information
nnethercote committed Feb 16, 2024
1 parent 5a12a89 commit 7b1ac28
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 7b1ac28

Please sign in to comment.