diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-10 11:49:27 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-10 11:49:33 +0100 |
| commit | dd9407dcbedc281a9fe9f11e63ab91410f49b44c (patch) | |
| tree | be3480c8217b7dd7b1dc30a17e702b4ac699da35 | |
| parent | ed5c3bc397c476f3969a736534fcf89e2523f489 (diff) | |
| download | rust-dd9407dcbedc281a9fe9f11e63ab91410f49b44c.tar.gz rust-dd9407dcbedc281a9fe9f11e63ab91410f49b44c.zip | |
use Instance::expect_resolve() instead of unwraping Instance::resolve()
| -rw-r--r-- | src/context.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/context.rs b/src/context.rs index bc3d62f2679..8f643c7db72 100644 --- a/src/context.rs +++ b/src/context.rs @@ -473,14 +473,12 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> { let tcx = self.tcx; let func = match tcx.lang_items().eh_personality() { Some(def_id) if !wants_msvc_seh(self.sess()) => { - let instance = ty::Instance::resolve( + let instance = ty::Instance::expect_resolve( tcx, ty::ParamEnv::reveal_all(), def_id, ty::List::empty(), - ) - .unwrap() - .unwrap(); + ); let symbol_name = tcx.symbol_name(instance).name; let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty()); |
