@@ -168,8 +168,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
168168 dst : PlaceRef < ' tcx , Bx :: Value > ,
169169 ) {
170170 // The MIR validator enforces no unsized transmutes.
171- debug_assert ! ( src. layout. is_sized( ) ) ;
172- debug_assert ! ( dst. layout. is_sized( ) ) ;
171+ assert ! ( src. layout. is_sized( ) ) ;
172+ assert ! ( dst. layout. is_sized( ) ) ;
173173
174174 if let Some ( val) = self . codegen_transmute_operand ( bx, src, dst. layout ) {
175175 val. store ( bx, dst) ;
@@ -223,8 +223,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
223223
224224 match operand. val {
225225 OperandValue :: Ref ( source_place_val) => {
226- debug_assert_eq ! ( source_place_val. llextra, None ) ;
227- debug_assert ! ( matches!( operand_kind, OperandValueKind :: Ref ) ) ;
226+ assert_eq ! ( source_place_val. llextra, None ) ;
227+ assert ! ( matches!( operand_kind, OperandValueKind :: Ref ) ) ;
228228 Some ( bx. load_operand ( source_place_val. with_type ( cast) ) . val )
229229 }
230230 OperandValue :: ZeroSized => {
@@ -295,7 +295,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
295295 to_scalar : abi:: Scalar ,
296296 to_backend_ty : Bx :: Type ,
297297 ) -> Bx :: Value {
298- debug_assert_eq ! ( from_scalar. size( self . cx) , to_scalar. size( self . cx) ) ;
298+ assert_eq ! ( from_scalar. size( self . cx) , to_scalar. size( self . cx) ) ;
299299
300300 use abi:: Primitive :: * ;
301301 imm = bx. from_immediate ( imm) ;
@@ -639,9 +639,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
639639 ( OperandValue :: Immediate ( llval) , operand. layout )
640640 }
641641 mir:: UnOp :: PtrMetadata => {
642- debug_assert ! (
643- operand. layout. ty. is_unsafe_ptr( ) || operand. layout. ty. is_ref( ) ,
644- ) ;
642+ assert ! ( operand. layout. ty. is_unsafe_ptr( ) || operand. layout. ty. is_ref( ) , ) ;
645643 let ( _, meta) = operand. val . pointer_parts ( ) ;
646644 assert_eq ! ( operand. layout. fields. count( ) > 1 , meta. is_some( ) ) ;
647645 if let Some ( meta) = meta {
@@ -651,7 +649,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
651649 }
652650 }
653651 } ;
654- debug_assert ! (
652+ assert ! (
655653 val. is_expected_variant_for_type( self . cx, layout) ,
656654 "Made wrong variant {val:?} for type {layout:?}" ,
657655 ) ;
@@ -742,7 +740,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
742740 bug ! ( "Field {field_idx:?} is {p:?} making {layout:?}" ) ;
743741 } ) ;
744742 let scalars = self . value_kind ( op. layout ) . scalars ( ) . unwrap ( ) ;
745- debug_assert_eq ! ( values. len( ) , scalars. len( ) ) ;
743+ assert_eq ! ( values. len( ) , scalars. len( ) ) ;
746744 inputs. extend ( values) ;
747745 input_scalars. extend ( scalars) ;
748746 }
@@ -760,7 +758,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
760758 ) ;
761759
762760 let val = OperandValue :: from_immediates ( inputs) ;
763- debug_assert ! (
761+ assert ! (
764762 val. is_expected_variant_for_type( self . cx, layout) ,
765763 "Made wrong variant {val:?} for type {layout:?}" ,
766764 ) ;
@@ -805,7 +803,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
805803 let val = cg_place. val . address ( ) ;
806804
807805 let ty = cg_place. layout . ty ;
808- debug_assert ! (
806+ assert ! (
809807 if bx. cx( ) . type_has_metadata( ty) {
810808 matches!( val, OperandValue :: Pair ( ..) )
811809 } else {
@@ -927,7 +925,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
927925 }
928926 mir:: BinOp :: Cmp => {
929927 use std:: cmp:: Ordering ;
930- debug_assert ! ( !is_float) ;
928+ assert ! ( !is_float) ;
931929 let pred = |op| base:: bin_op_to_icmp_predicate ( op, is_signed) ;
932930 if bx. cx ( ) . tcx ( ) . sess . opts . optimize == OptLevel :: No {
933931 // FIXME: This actually generates tighter assembly, and is a classic trick
@@ -1111,7 +1109,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
11111109 if layout. is_zst ( ) {
11121110 OperandValueKind :: ZeroSized
11131111 } else if self . cx . is_backend_immediate ( layout) {
1114- debug_assert ! ( !self . cx. is_backend_scalar_pair( layout) ) ;
1112+ assert ! ( !self . cx. is_backend_scalar_pair( layout) ) ;
11151113 OperandValueKind :: Immediate ( match layout. abi {
11161114 abi:: Abi :: Scalar ( s) => s,
11171115 abi:: Abi :: Vector { element, .. } => element,
0 commit comments