diff options
| author | Michael Goulet <michael@errs.io> | 2022-12-11 19:46:58 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-11 19:48:24 +0000 |
| commit | bc293ed53e9a747b12e03eee43df96d47e362bd2 (patch) | |
| tree | 1a7ddff1ed774da43bad99f0bfda6bbf67213d47 /compiler/rustc_codegen_cranelift/src | |
| parent | d137783642b0b98eda2796dc66bffc2b089a8327 (diff) | |
| download | rust-bc293ed53e9a747b12e03eee43df96d47e362bd2.tar.gz rust-bc293ed53e9a747b12e03eee43df96d47e362bd2.zip | |
bug! with a better error message for failing Instance::resolve
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/abi/mod.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs index 1e22537c2ba..98b5fb1cce2 100644 --- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs @@ -349,10 +349,9 @@ pub(crate) fn codegen_terminator_call<'tcx>( // Handle special calls like intrinsics and empty drop glue. let instance = if let ty::FnDef(def_id, substs) = *fn_ty.kind() { - let instance = ty::Instance::resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs) - .unwrap() - .unwrap() - .polymorphize(fx.tcx); + let instance = + ty::Instance::expect_resolve(fx.tcx, ty::ParamEnv::reveal_all(), def_id, substs) + .polymorphize(fx.tcx); if fx.tcx.symbol_name(instance).name.starts_with("llvm.") { crate::intrinsics::codegen_llvm_intrinsic_call( |
