@@ -120,7 +120,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
120120 /// A counter that is used for generating local symbol names
121121 local_gen_sym_counter : Cell < usize > ,
122122
123- eh_personality : Cell < Option < RValue < ' gcc > > > ,
123+ eh_personality : Cell < Option < Function < ' gcc > > > ,
124124 #[ cfg( feature = "master" ) ]
125125 pub rust_try_fn : Cell < Option < ( Type < ' gcc > , Function < ' gcc > ) > > ,
126126
@@ -428,7 +428,7 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
428428 ptr
429429 }
430430
431- fn eh_personality ( & self ) -> RValue < ' gcc > {
431+ fn eh_personality ( & self ) -> Function < ' gcc > {
432432 // The exception handling personality function.
433433 //
434434 // If our compilation unit has the `eh_personality` lang item somewhere
@@ -466,18 +466,15 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
466466 let symbol_name = tcx. symbol_name ( instance) . name ;
467467 let fn_abi = self . fn_abi_of_instance ( instance, ty:: List :: empty ( ) ) ;
468468 self . linkage . set ( FunctionType :: Extern ) ;
469- let func = self . declare_fn ( symbol_name, fn_abi) ;
470- let func: RValue < ' gcc > = unsafe { std:: mem:: transmute ( func) } ;
471- func
469+ self . declare_fn ( symbol_name, fn_abi)
472470 }
473471 _ => {
474472 let name = if wants_msvc_seh ( self . sess ( ) ) {
475473 "__CxxFrameHandler3"
476474 } else {
477475 "rust_eh_personality"
478476 } ;
479- let func = self . declare_func ( name, self . type_i32 ( ) , & [ ] , true ) ;
480- unsafe { std:: mem:: transmute :: < Function < ' gcc > , RValue < ' gcc > > ( func) }
477+ self . declare_func ( name, self . type_i32 ( ) , & [ ] , true )
481478 }
482479 } ;
483480 // TODO(antoyo): apply target cpu attributes.
0 commit comments