@@ -294,7 +294,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
294294 if arg_uninhabited {
295295 fx. bcx . append_block_params_for_function_params ( fx. block_map [ START_BLOCK ] ) ;
296296 fx. bcx . switch_to_block ( fx. block_map [ START_BLOCK ] ) ;
297- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
297+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
298298 return ;
299299 }
300300 fx. tcx
@@ -311,7 +311,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
311311 if !reachable_blocks. contains ( bb) {
312312 // We want to skip this block, because it's not reachable. But we still create
313313 // the block so terminators in other blocks can reference it.
314- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
314+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
315315 continue ;
316316 }
317317
@@ -540,11 +540,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
540540 }
541541 TerminatorKind :: UnwindResume => {
542542 // FIXME implement unwinding
543- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
543+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
544544 }
545545 TerminatorKind :: Unreachable => {
546546 fx. bcx . set_cold_block ( block) ;
547- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
547+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
548548 }
549549 TerminatorKind :: Yield { .. }
550550 | TerminatorKind :: FalseEdge { .. }
@@ -1082,7 +1082,7 @@ fn codegen_panic_inner<'tcx>(
10821082 let instance = Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
10831083
10841084 if is_call_from_compiler_builtins_to_upstream_monomorphization ( fx. tcx , instance) {
1085- fx. bcx . ins ( ) . trap ( TrapCode :: User ( 0 ) ) ;
1085+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 2 ) . unwrap ( ) ) ;
10861086 return ;
10871087 }
10881088
@@ -1095,5 +1095,5 @@ fn codegen_panic_inner<'tcx>(
10951095 args,
10961096 ) ;
10971097
1098- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
1098+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
10991099}
0 commit comments