@@ -25,12 +25,6 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, '_>, msg: &str) {
2525 fx. bcx . ins ( ) . call ( puts, & [ msg_ptr] ) ;
2626}
2727
28- /// Trap code: user1
29- pub ( crate ) fn trap_abort ( fx : & mut FunctionCx < ' _ , ' _ , ' _ > , msg : impl AsRef < str > ) {
30- codegen_print ( fx, msg. as_ref ( ) ) ;
31- fx. bcx . ins ( ) . trap ( TrapCode :: User ( 1 ) ) ;
32- }
33-
3428/// Use this for example when a function call should never return. This will fill the current block,
3529/// so you can **not** add instructions to it afterwards.
3630///
@@ -39,21 +33,6 @@ pub(crate) fn trap_unreachable(fx: &mut FunctionCx<'_, '_, '_>, msg: impl AsRef<
3933 codegen_print ( fx, msg. as_ref ( ) ) ;
4034 fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
4135}
42-
43- /// Like `trap_unreachable` but returns a fake value of the specified type.
44- ///
45- /// Trap code: user65535
46- pub ( crate ) fn trap_unreachable_ret_value < ' tcx > (
47- fx : & mut FunctionCx < ' _ , ' _ , ' tcx > ,
48- dest_layout : TyAndLayout < ' tcx > ,
49- msg : impl AsRef < str > ,
50- ) -> CValue < ' tcx > {
51- codegen_print ( fx, msg. as_ref ( ) ) ;
52- let true_ = fx. bcx . ins ( ) . iconst ( types:: I32 , 1 ) ;
53- fx. bcx . ins ( ) . trapnz ( true_, TrapCode :: UnreachableCodeReached ) ;
54- CValue :: by_ref ( Pointer :: const_addr ( fx, 0 ) , dest_layout)
55- }
56-
5736/// Use this when something is unimplemented, but `libcore` or `libstd` requires it to codegen.
5837/// Unlike `trap_unreachable` this will not fill the current block, so you **must** add instructions
5938/// to it afterwards.
0 commit comments