From 1ac066ef047fcead574876b04f86a684b8362c58 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 7 Dec 2018 17:33:32 +0100 Subject: [PATCH] Fix the just-introduced ptr::hash docs --- src/libcore/ptr.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 8630dd402ef..69854c5a5d9 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2516,8 +2516,11 @@ pub fn eq(a: *const T, b: *const T) -> bool { a == b } -/// Hash the raw pointer address behind a reference, rather than the value -/// it points to. +/// Hash a raw pointer. +/// +/// This can be used to hash a `&T` reference (which coerce to `*const T` implicitly) +/// by its address rather than the value it points to +/// (which is what the `Hash for &T` implementation does). /// /// # Examples ///