@@ -75,6 +75,7 @@ use core::mem::ManuallyDrop;
75
75
use core:: mem:: MaybeUninit ;
76
76
use core:: ptr:: addr_of;
77
77
use core:: ptr:: addr_of_mut;
78
+ use core:: ptr:: copy;
78
79
use core:: ptr:: copy_nonoverlapping;
79
80
80
81
use core:: marker:: PhantomData ;
@@ -349,7 +350,7 @@ impl<'a, T: 'a, const N: usize> Drop for Drain<'a, T, N> {
349
350
let ptr = source_vec. as_mut_ptr ( ) ;
350
351
let src = ptr. add ( tail) ;
351
352
let dst = ptr. add ( start) ;
352
- core :: ptr :: copy ( src, dst, self . tail_len ) ;
353
+ copy ( src, dst, self . tail_len ) ;
353
354
}
354
355
source_vec. set_len ( start + self . tail_len ) ;
355
356
}
@@ -864,7 +865,7 @@ impl<T, const N: usize> SmallVec<T, N> {
864
865
let ptr = self . as_mut_ptr ( ) ;
865
866
let ith = ptr. add ( index) ;
866
867
let ith_item = ith. read ( ) ;
867
- core :: ptr :: copy ( ith. add ( 1 ) , ith, new_len - index) ;
868
+ copy ( ith. add ( 1 ) , ith, new_len - index) ;
868
869
ith_item
869
870
}
870
871
}
@@ -877,7 +878,7 @@ impl<T, const N: usize> SmallVec<T, N> {
877
878
let ptr = self . as_mut_ptr ( ) ;
878
879
unsafe {
879
880
if index < len {
880
- core :: ptr :: copy ( ptr. add ( index) , ptr. add ( index + 1 ) , len - index) ;
881
+ copy ( ptr. add ( index) , ptr. add ( index + 1 ) , len - index) ;
881
882
}
882
883
ptr. add ( index) . write ( value) ;
883
884
self . set_len ( len + 1 ) ;
@@ -1114,7 +1115,7 @@ impl<T: Copy, const N: usize> SmallVec<T, N> {
1114
1115
let base_ptr = self . as_mut_ptr ( ) ;
1115
1116
let ith_ptr = base_ptr. add ( index) ;
1116
1117
let shifted_ptr = base_ptr. add ( index + other_len) ;
1117
- core :: ptr :: copy ( ith_ptr, shifted_ptr, len - index) ;
1118
+ copy ( ith_ptr, shifted_ptr, len - index) ;
1118
1119
copy_nonoverlapping ( slice. as_ptr ( ) , ith_ptr, other_len) ;
1119
1120
self . set_len ( len + other_len) ;
1120
1121
}
@@ -1180,7 +1181,7 @@ impl<T> Drop for DropShiftGuard<T> {
1180
1181
fn drop ( & mut self ) {
1181
1182
unsafe {
1182
1183
core:: ptr:: slice_from_raw_parts_mut ( self . ptr , self . len ) . drop_in_place ( ) ;
1183
- core :: ptr :: copy ( self . shifted_ptr , self . ptr , self . shifted_len ) ;
1184
+ copy ( self . shifted_ptr , self . ptr , self . shifted_len ) ;
1184
1185
}
1185
1186
}
1186
1187
}
@@ -1206,7 +1207,7 @@ unsafe fn insert_many_batch_phase<T, I: Iterator<Item = T>>(
1206
1207
iter : & mut I ,
1207
1208
) -> usize {
1208
1209
// shift elements to the right to make space for the initial elements from the iterator
1209
- core :: ptr :: copy ( ptr. add ( index) , ptr. add ( index + lower_bound) , len - index) ;
1210
+ copy ( ptr. add ( index) , ptr. add ( index + lower_bound) , len - index) ;
1210
1211
let ptr_ith = ptr. add ( index) ;
1211
1212
let mut guard = DropShiftGuard {
1212
1213
ptr : ptr_ith,
@@ -1222,7 +1223,7 @@ unsafe fn insert_many_batch_phase<T, I: Iterator<Item = T>>(
1222
1223
core:: mem:: forget ( guard) ;
1223
1224
1224
1225
if count < lower_bound {
1225
- core :: ptr :: copy ( ptr_ith. add ( lower_bound) , ptr_ith. add ( count) , len - index) ;
1226
+ copy ( ptr_ith. add ( lower_bound) , ptr_ith. add ( count) , len - index) ;
1226
1227
}
1227
1228
count
1228
1229
}
0 commit comments