@@ -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
@@ -541,10 +541,10 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
541
541
}
542
542
TerminatorKind :: UnwindResume => {
543
543
// FIXME implement unwinding
544
- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
544
+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
545
545
}
546
546
TerminatorKind :: Unreachable => {
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 { .. }
@@ -1080,7 +1080,7 @@ fn codegen_panic_inner<'tcx>(
1080
1080
let instance = Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
1081
1081
1082
1082
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 ( ) ) ;
1084
1084
return ;
1085
1085
}
1086
1086
@@ -1093,5 +1093,5 @@ fn codegen_panic_inner<'tcx>(
1093
1093
args,
1094
1094
) ;
1095
1095
1096
- fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
1096
+ fx. bcx . ins ( ) . trap ( TrapCode :: user ( 1 /* unreachable */ ) . unwrap ( ) ) ;
1097
1097
}
0 commit comments