about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcore/ptr/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index 80f865d79e4..29956ae1a36 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -252,7 +252,7 @@ pub(crate) struct FatPtr<T> {
 ///
 /// // create a slice pointer when starting out with a pointer to the first element
 /// let x = [5, 6, 7];
-/// let ptr = &x[0] as *const _;
+/// let ptr = x.as_ptr();
 /// let slice = ptr::slice_from_raw_parts(ptr, 3);
 /// assert_eq!(unsafe { &*slice }[2], 7);
 /// ```