@@ -145,7 +145,7 @@ impl Repr {
145145 let p = Box :: into_raw ( b) . cast :: < u8 > ( ) ;
146146 // Should only be possible if an allocator handed out a pointer with
147147 // wrong alignment.
148- debug_assert_eq ! ( p. addr( ) & TAG_MASK , 0 ) ;
148+ assert_eq ! ( p. addr( ) & TAG_MASK , 0 ) ;
149149 // Note: We know `TAG_CUSTOM <= size_of::<Custom>()` (static_assert at
150150 // end of file), and both the start and end of the expression must be
151151 // valid without address space wraparound due to `Box`'s semantics.
@@ -167,7 +167,7 @@ impl Repr {
167167 let res = Self ( unsafe { NonNull :: new_unchecked ( tagged) } , PhantomData ) ;
168168 // quickly smoke-check we encoded the right thing (This generally will
169169 // only run in libstd's tests, unless the user uses -Zbuild-std)
170- debug_assert ! ( matches!( res. data( ) , ErrorData :: Custom ( _) ) , "repr(custom) encoding failed" ) ;
170+ assert ! ( matches!( res. data( ) , ErrorData :: Custom ( _) ) , "repr(custom) encoding failed" ) ;
171171 res
172172 }
173173
@@ -178,7 +178,7 @@ impl Repr {
178178 let res = Self ( unsafe { NonNull :: new_unchecked ( ptr:: invalid_mut ( utagged) ) } , PhantomData ) ;
179179 // quickly smoke-check we encoded the right thing (This generally will
180180 // only run in libstd's tests, unless the user uses -Zbuild-std)
181- debug_assert ! (
181+ assert ! (
182182 matches!( res. data( ) , ErrorData :: Os ( c) if c == code) ,
183183 "repr(os) encoding failed for {code}"
184184 ) ;
@@ -192,7 +192,7 @@ impl Repr {
192192 let res = Self ( unsafe { NonNull :: new_unchecked ( ptr:: invalid_mut ( utagged) ) } , PhantomData ) ;
193193 // quickly smoke-check we encoded the right thing (This generally will
194194 // only run in libstd's tests, unless the user uses -Zbuild-std)
195- debug_assert ! (
195+ assert ! (
196196 matches!( res. data( ) , ErrorData :: Simple ( k) if k == kind) ,
197197 "repr(simple) encoding failed {:?}" ,
198198 kind,
@@ -256,7 +256,7 @@ where
256256 TAG_SIMPLE => {
257257 let kind_bits = ( bits >> 32 ) as u32 ;
258258 let kind = kind_from_prim ( kind_bits) . unwrap_or_else ( || {
259- debug_assert ! ( false , "Invalid io::error::Repr bits: `Repr({:#018x})`" , bits) ;
259+ assert ! ( false , "Invalid io::error::Repr bits: `Repr({:#018x})`" , bits) ;
260260 // This means the `ptr` passed in was not valid, which violates
261261 // the unsafe contract of `decode_repr`.
262262 //
0 commit comments