Skip to content

Commit f7c76ad

Browse files
bug! with a better error message for failing Instance::resolve
1 parent 34336b8 commit f7c76ad

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/abi/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,9 @@ pub(crate) fn codegen_terminator_call<'tcx>(
349349

350350
// Handle special calls like intrinsics and empty drop glue.
351351
let instance = if let ty::FnDef(def_id, substs) = *fn_ty.kind() {
352-
let instance = ty::Instance::resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs)
353-
.unwrap()
354-
.unwrap()
355-
.polymorphize(fx.tcx);
352+
let instance =
353+
ty::Instance::expect_resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs)
354+
.polymorphize(fx.tcx);
356355

357356
if fx.tcx.symbol_name(instance).name.starts_with("llvm.") {
358357
crate::intrinsics::codegen_llvm_intrinsic_call(

0 commit comments

Comments
 (0)