@@ -135,8 +135,8 @@ intrinsics! {
135
135
/// eight bytes.
136
136
#[ cfg( not( target_vendor = "apple" ) ) ]
137
137
pub unsafe extern "aapcs" fn __aeabi_memcpy8( dst: * mut u8 , src: * const u8 , n: usize ) {
138
- debug_assert!( dst. addr( ) & 7 == 0 ) ;
139
- debug_assert!( src. addr( ) & 7 == 0 ) ;
138
+ debug_assert!( dst. addr( ) . is_multiple_of ( 8 ) ) ;
139
+ debug_assert!( src. addr( ) . is_multiple_of ( 8 ) ) ;
140
140
141
141
// SAFETY: memcpy preconditions apply, less strict alignment.
142
142
unsafe { __aeabi_memcpy4( dst, src, n) } ;
@@ -161,8 +161,8 @@ intrinsics! {
161
161
/// four bytes.
162
162
#[ cfg( not( any( target_vendor = "apple" , target_env = "msvc" ) ) ) ]
163
163
pub unsafe extern "aapcs" fn __aeabi_memmove4( dst: * mut u8 , src: * const u8 , n: usize ) {
164
- debug_assert!( dst. addr( ) & 3 == 0 ) ;
165
- debug_assert!( src. addr( ) & 3 == 0 ) ;
164
+ debug_assert!( dst. addr( ) . is_multiple_of ( 4 ) ) ;
165
+ debug_assert!( src. addr( ) . is_multiple_of ( 4 ) ) ;
166
166
167
167
// SAFETY: same preconditions, less strict aligment.
168
168
unsafe { __aeabi_memmove( dst, src, n) } ;
@@ -176,8 +176,8 @@ intrinsics! {
176
176
/// eight bytes.
177
177
#[ cfg( not( any( target_vendor = "apple" , target_env = "msvc" ) ) ) ]
178
178
pub unsafe extern "aapcs" fn __aeabi_memmove8( dst: * mut u8 , src: * const u8 , n: usize ) {
179
- debug_assert!( dst. addr( ) & 7 == 0 ) ;
180
- debug_assert!( src. addr( ) & 7 == 0 ) ;
179
+ debug_assert!( dst. addr( ) . is_multiple_of ( 8 ) ) ;
180
+ debug_assert!( src. addr( ) . is_multiple_of ( 8 ) ) ;
181
181
182
182
// SAFETY: memmove preconditions apply, less strict alignment.
183
183
unsafe { __aeabi_memmove( dst, src, n) } ;
@@ -236,7 +236,7 @@ intrinsics! {
236
236
/// eight bytes.
237
237
#[ cfg( not( target_vendor = "apple" ) ) ]
238
238
pub unsafe extern "aapcs" fn __aeabi_memset8( dst: * mut u8 , n: usize , c: i32 ) {
239
- debug_assert!( dst. addr( ) & 7 == 0 ) ;
239
+ debug_assert!( dst. addr( ) . is_multiple_of ( 8 ) ) ;
240
240
241
241
// SAFETY: memset preconditions apply, less strict alignment.
242
242
unsafe { __aeabi_memset4( dst, n, c) } ;
@@ -261,7 +261,7 @@ intrinsics! {
261
261
/// four bytes.
262
262
#[ cfg( not( any( target_vendor = "apple" , target_env = "msvc" ) ) ) ]
263
263
pub unsafe extern "aapcs" fn __aeabi_memclr4( dst: * mut u8 , n: usize ) {
264
- debug_assert!( dst. addr( ) & 3 == 0 ) ;
264
+ debug_assert!( dst. addr( ) . is_multiple_of ( 4 ) ) ;
265
265
266
266
// SAFETY: memclr preconditions apply, less strict alignment.
267
267
unsafe { __aeabi_memset4( dst, n, 0 ) } ;
@@ -275,7 +275,7 @@ intrinsics! {
275
275
/// eight bytes.
276
276
#[ cfg( not( any( target_vendor = "apple" , target_env = "msvc" ) ) ) ]
277
277
pub unsafe extern "aapcs" fn __aeabi_memclr8( dst: * mut u8 , n: usize ) {
278
- debug_assert!( dst. addr( ) & 7 == 0 ) ;
278
+ debug_assert!( dst. addr( ) . is_multiple_of ( 8 ) ) ;
279
279
280
280
// SAFETY: memclr preconditions apply, less strict alignment.
281
281
unsafe { __aeabi_memset4( dst, n, 0 ) } ;
0 commit comments