@@ -542,8 +542,8 @@ impl<T> Vec<T> {
542
542
///
543
543
/// unsafe {
544
544
/// // Overwrite memory with 4, 5, 6
545
- /// for i in 0..len as isize {
546
- /// ptr::write(p.offset (i), 4 + i);
545
+ /// for i in 0..len {
546
+ /// ptr::write(p.add (i), 4 + i);
547
547
/// }
548
548
///
549
549
/// // Put everything back together into a Vec
@@ -702,8 +702,8 @@ impl<T, A: Allocator> Vec<T, A> {
702
702
///
703
703
/// unsafe {
704
704
/// // Overwrite memory with 4, 5, 6
705
- /// for i in 0..len as isize {
706
- /// ptr::write(p.offset (i), 4 + i);
705
+ /// for i in 0..len {
706
+ /// ptr::write(p.add (i), 4 + i);
707
707
/// }
708
708
///
709
709
/// // Put everything back together into a Vec
@@ -1393,7 +1393,7 @@ impl<T, A: Allocator> Vec<T, A> {
1393
1393
if index < len {
1394
1394
// Shift everything over to make space. (Duplicating the
1395
1395
// `index`th element into two consecutive places.)
1396
- ptr:: copy ( p, p. offset ( 1 ) , len - index) ;
1396
+ ptr:: copy ( p, p. add ( 1 ) , len - index) ;
1397
1397
} else if index == len {
1398
1398
// No elements need shifting.
1399
1399
} else {
@@ -1455,7 +1455,7 @@ impl<T, A: Allocator> Vec<T, A> {
1455
1455
ret = ptr:: read ( ptr) ;
1456
1456
1457
1457
// Shift everything down to fill in that spot.
1458
- ptr:: copy ( ptr. offset ( 1 ) , ptr, len - index - 1 ) ;
1458
+ ptr:: copy ( ptr. add ( 1 ) , ptr, len - index - 1 ) ;
1459
1459
}
1460
1460
self . set_len ( len - 1 ) ;
1461
1461
ret
@@ -2408,7 +2408,7 @@ impl<T, A: Allocator> Vec<T, A> {
2408
2408
// Write all elements except the last one
2409
2409
for _ in 1 ..n {
2410
2410
ptr:: write ( ptr, value. next ( ) ) ;
2411
- ptr = ptr. offset ( 1 ) ;
2411
+ ptr = ptr. add ( 1 ) ;
2412
2412
// Increment the length in every step in case next() panics
2413
2413
local_len. increment_len ( 1 ) ;
2414
2414
}
0 commit comments