@@ -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
@@ -541,10 +541,10 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
541541 }
542542 TerminatorKind :: UnwindResume => {
543543 // FIXME implement unwinding
544- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
544+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
545545 }
546546 TerminatorKind :: Unreachable => {
547- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
547+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
548548 }
549549 TerminatorKind :: Yield { .. }
550550 | TerminatorKind :: FalseEdge { .. }
@@ -1080,7 +1080,7 @@ fn codegen_panic_inner<'tcx>(
10801080 let instance = Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
10811081
10821082 if is_call_from_compiler_builtins_to_upstream_monomorphization ( fx. tcx , instance) {
1083- fx. bcx . ins ( ) . trap ( TrapCode :: User ( 0 ) ) ;
1083+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 2 ) . unwrap ( ) ) ;
10841084 return ;
10851085 }
10861086
@@ -1093,5 +1093,5 @@ fn codegen_panic_inner<'tcx>(
10931093 args,
10941094 ) ;
10951095
1096- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
1096+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
10971097}
0 commit comments