@@ -474,10 +474,10 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
474474 * destination,
475475 ) ;
476476 }
477- TerminatorKind :: Terminate => {
478- codegen_panic_cannot_unwind ( fx, source_info) ;
477+ TerminatorKind :: UnwindTerminate ( reason ) => {
478+ codegen_unwind_terminate ( fx, source_info, * reason ) ;
479479 }
480- TerminatorKind :: Resume => {
480+ TerminatorKind :: UnwindResume => {
481481 // FIXME implement unwinding
482482 fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
483483 }
@@ -971,13 +971,14 @@ pub(crate) fn codegen_panic_nounwind<'tcx>(
971971 codegen_panic_inner ( fx, rustc_hir:: LangItem :: PanicNounwind , & args, source_info. span ) ;
972972}
973973
974- pub ( crate ) fn codegen_panic_cannot_unwind < ' tcx > (
974+ pub ( crate ) fn codegen_unwind_terminate < ' tcx > (
975975 fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
976976 source_info : mir:: SourceInfo ,
977+ reason : UnwindTerminateReason ,
977978) {
978979 let args = [ ] ;
979980
980- codegen_panic_inner ( fx, rustc_hir :: LangItem :: PanicCannotUnwind , & args, source_info. span ) ;
981+ codegen_panic_inner ( fx, reason . lang_item ( ) , & args, source_info. span ) ;
981982}
982983
983984fn codegen_panic_inner < ' tcx > (
0 commit comments