Skip to content

Commit

Permalink
Rollup merge of rust-lang#121209 - nnethercote:infallible-join_codege…
Browse files Browse the repository at this point in the history
…n, r=bjorn3

Make `CodegenBackend::join_codegen` infallible.

Because they all are, in practice.

r? ```@bjorn3```
  • Loading branch information
matthiaskrgr committed Feb 17, 2024
2 parents e9aa254 + 7b1ac28 commit bd53510
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 bd53510

Please sign in to comment.