use Instance::expect_resolve() instead of unwraping Instance::resolve()

This commit is contained in:
Ralf Jung 2024-03-10 11:49:27 +01:00
parent ed5c3bc397
commit dd9407dcbe

View File

@ -473,14 +473,12 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
let tcx = self.tcx; let tcx = self.tcx;
let func = match tcx.lang_items().eh_personality() { let func = match tcx.lang_items().eh_personality() {
Some(def_id) if !wants_msvc_seh(self.sess()) => { Some(def_id) if !wants_msvc_seh(self.sess()) => {
let instance = ty::Instance::resolve( let instance = ty::Instance::expect_resolve(
tcx, tcx,
ty::ParamEnv::reveal_all(), ty::ParamEnv::reveal_all(),
def_id, def_id,
ty::List::empty(), ty::List::empty(),
) );
.unwrap()
.unwrap();
let symbol_name = tcx.symbol_name(instance).name; let symbol_name = tcx.symbol_name(instance).name;
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty()); let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());