@@ -294,7 +294,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
294
294
if arg_uninhabited {
295
295
fx. bcx . append_block_params_for_function_params ( fx. block_map [ START_BLOCK ] ) ;
296
296
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 ( ) ) ;
298
298
return ;
299
299
}
300
300
fx. tcx
@@ -311,7 +311,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
311
311
if !reachable_blocks. contains ( bb) {
312
312
// We want to skip this block, because it's not reachable. But we still create
313
313
// 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 ( ) ) ;
315
315
continue ;
316
316
}
317
317
@@ -540,11 +540,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
540
540
}
541
541
TerminatorKind :: UnwindResume => {
542
542
// FIXME implement unwinding
543
- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
543
+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
544
544
}
545
545
TerminatorKind :: Unreachable => {
546
546
fx. bcx . set_cold_block ( block) ;
547
- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
547
+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
548
548
}
549
549
TerminatorKind :: Yield { .. }
550
550
| TerminatorKind :: FalseEdge { .. }
@@ -1082,7 +1082,7 @@ fn codegen_panic_inner<'tcx>(
1082
1082
let instance = Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
1083
1083
1084
1084
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 ( ) ) ;
1086
1086
return ;
1087
1087
}
1088
1088
@@ -1095,5 +1095,5 @@ fn codegen_panic_inner<'tcx>(
1095
1095
args,
1096
1096
) ;
1097
1097
1098
- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
1098
+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
1099
1099
}
0 commit comments