about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-03-10 11:49:27 +0100
committerRalf Jung <post@ralfj.de>2024-03-10 11:49:33 +0100
commitaa9145e6ea9ae518355b2c8c7f6de6d61c385e38 (patch)
tree3879e04522105863a96f4a018cd4861ec177674e /compiler/rustc_codegen_llvm/src
parent094a6204f590e6b4770b5f26359dd17a07897adf (diff)
downloadrust-aa9145e6ea9ae518355b2c8c7f6de6d61c385e38.tar.gz
rust-aa9145e6ea9ae518355b2c8c7f6de6d61c385e38.zip
use Instance::expect_resolve() instead of unwraping Instance::resolve()
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index d1f32087908..37c690a0128 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -558,11 +558,12 @@ impl<'ll, 'tcx> MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
 
         let tcx = self.tcx;
         let llfn = match tcx.lang_items().eh_personality() {
-            Some(def_id) if name.is_none() => self.get_fn_addr(
-                ty::Instance::resolve(tcx, ty::ParamEnv::reveal_all(), def_id, ty::List::empty())
-                    .unwrap()
-                    .unwrap(),
-            ),
+            Some(def_id) if name.is_none() => self.get_fn_addr(ty::Instance::expect_resolve(
+                tcx,
+                ty::ParamEnv::reveal_all(),
+                def_id,
+                ty::List::empty(),
+            )),
             _ => {
                 let name = name.unwrap_or("rust_eh_personality");
                 if let Some(llfn) = self.get_declared_value(name) {