Skip to content

Commit 433f347

Browse files
committed
don't ICE on missing exchange_* lang items
1 parent e13d352 commit 433f347

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_trans/trans/collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
501501
.tcx()
502502
.lang_items
503503
.require(ExchangeMallocFnLangItem)
504-
.expect("Could not find ExchangeMallocFnLangItem");
504+
.unwrap_or_else(|e| self.ccx.sess().fatal(&e));
505505

506506
assert!(can_have_local_instance(self.ccx, exchange_malloc_fn_def_id));
507507
let exchange_malloc_fn_trans_item =
@@ -645,7 +645,7 @@ fn find_drop_glue_neighbors<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
645645
let exchange_free_fn_def_id = ccx.tcx()
646646
.lang_items
647647
.require(ExchangeFreeFnLangItem)
648-
.expect("Could not find ExchangeFreeFnLangItem");
648+
.unwrap_or_else(|e| ccx.sess().fatal(&e));
649649

650650
assert!(can_have_local_instance(ccx, exchange_free_fn_def_id));
651651
let exchange_free_fn_trans_item =

0 commit comments

Comments
 (0)