about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcohenarthur <arthur.cohen@epita.fr>2020-04-23 22:22:27 +0200
committercohenarthur <arthur.cohen@epita.fr>2020-04-23 22:22:27 +0200
commitb4a11d4dd971be4a2e055e4f92fece030615a692 (patch)
tree818ebcedefec30c292585a8364d74e40ace38a70
parent413a12909f3b149af17d75268ed4a136afb82c36 (diff)
downloadrust-b4a11d4dd971be4a2e055e4f92fece030615a692.tar.gz
rust-b4a11d4dd971be4a2e055e4f92fece030615a692.zip
doc-example: Refactor pointer name to avoid confusion
Changed raw pointer name from ptr to raw_pointer to avoid confusion with
the `use std::ptr` statement a few lines above. This way the crate name
and pointer name are well differenciated.
-rw-r--r--src/libcore/ptr/mod.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index 84f28488c74..54d44222d3f 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -65,8 +65,6 @@
 //! [`write_volatile`]: ./fn.write_volatile.html
 //! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling
 
-// ignore-tidy-undocumented-unsafe
-
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::cmp::Ordering;
@@ -248,8 +246,8 @@ 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.as_ptr();
-/// let slice = ptr::slice_from_raw_parts(ptr, 3);
+/// let raw_pointer = x.as_ptr();
+/// let slice = ptr::slice_from_raw_parts(raw_pointer, 3);
 /// assert_eq!(unsafe { &*slice }[2], 7);
 /// ```
 #[inline]