Skip to content

don't ICE on a couple of missing lang items #31564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librustc_mir/build/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ fn build_free<'tcx>(tcx: &ty::ctxt<'tcx>,
unit_temp: Lvalue<'tcx>,
data: &FreeData<'tcx>,
target: BasicBlock) -> Terminator<'tcx> {
let free_func = tcx.lang_items.box_free_fn()
.expect("box_free language item is missing");
let free_func = tcx.lang_items.require(lang_items::BoxFreeFnLangItem)
.unwrap_or_else(|e| tcx.sess.fatal(&e));
let substs = tcx.mk_substs(Substs::new(
VecPerParamSpace::new(vec![], vec![], vec![data.item_ty]),
VecPerParamSpace::new(vec![], vec![], vec![])
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/trans/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
.tcx()
.lang_items
.require(ExchangeMallocFnLangItem)
.expect("Could not find ExchangeMallocFnLangItem");
.unwrap_or_else(|e| self.ccx.sess().fatal(&e));

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

assert!(can_have_local_instance(ccx, exchange_free_fn_def_id));
let exchange_free_fn_trans_item =
Expand Down