@@ -542,8 +542,8 @@ impl<T> Vec<T> {
542542 ///
543543 /// unsafe {
544544 /// // 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);
547547 /// }
548548 ///
549549 /// // Put everything back together into a Vec
@@ -702,8 +702,8 @@ impl<T, A: Allocator> Vec<T, A> {
702702 ///
703703 /// unsafe {
704704 /// // 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);
707707 /// }
708708 ///
709709 /// // Put everything back together into a Vec
@@ -1393,7 +1393,7 @@ impl<T, A: Allocator> Vec<T, A> {
13931393 if index < len {
13941394 // Shift everything over to make space. (Duplicating the
13951395 // `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) ;
13971397 } else if index == len {
13981398 // No elements need shifting.
13991399 } else {
@@ -1455,7 +1455,7 @@ impl<T, A: Allocator> Vec<T, A> {
14551455 ret = ptr:: read ( ptr) ;
14561456
14571457 // 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 ) ;
14591459 }
14601460 self . set_len ( len - 1 ) ;
14611461 ret
@@ -2408,7 +2408,7 @@ impl<T, A: Allocator> Vec<T, A> {
24082408 // Write all elements except the last one
24092409 for _ in 1 ..n {
24102410 ptr:: write ( ptr, value. next ( ) ) ;
2411- ptr = ptr. offset ( 1 ) ;
2411+ ptr = ptr. add ( 1 ) ;
24122412 // Increment the length in every step in case next() panics
24132413 local_len. increment_len ( 1 ) ;
24142414 }
0 commit comments