Skip to content

Commit 7f076fa

Browse files
authored
Rollup merge of rust-lang#56602 - dwijnand:fix-ptr-hash-docs, r=Centril
Fix the just-introduced ptr::hash docs Follow-up to rust-lang#56250.
2 parents eb30d56 + ba3db7b commit 7f076fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libcore/ptr.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2516,8 +2516,11 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
25162516
a == b
25172517
}
25182518

2519-
/// Hash the raw pointer address behind a reference, rather than the value
2520-
/// it points to.
2519+
/// Hash a raw pointer.
2520+
///
2521+
/// This can be used to hash a `&T` reference (which coerces to `*const T` implicitly)
2522+
/// by its address rather than the value it points to
2523+
/// (which is what the `Hash for &T` implementation does).
25212524
///
25222525
/// # Examples
25232526
///

0 commit comments

Comments
 (0)