Skip to content

Commit 6264952

Browse files
committed
Fix doctest mutability copy-pasta
1 parent 4a097ea commit 6264952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ impl<T: ?Sized> *mut T {
15161516
/// ```
15171517
/// #![feature(ptr_offset_from)]
15181518
///
1519-
/// let a = [0; 5];
1519+
/// let mut a = [0; 5];
15201520
/// let ptr1: *mut i32 = &mut a[1];
15211521
/// let ptr2: *mut i32 = &mut a[3];
15221522
/// unsafe {
@@ -1554,7 +1554,7 @@ impl<T: ?Sized> *mut T {
15541554
/// ```
15551555
/// #![feature(ptr_wrapping_offset_from)]
15561556
///
1557-
/// let a = [0; 5];
1557+
/// let mut a = [0; 5];
15581558
/// let ptr1: *mut i32 = &mut a[1];
15591559
/// let ptr2: *mut i32 = &mut a[3];
15601560
/// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);

0 commit comments

Comments
 (0)