File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2516,18 +2516,19 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
25162516///
25172517/// ```
25182518/// use std::collections::hash_map::DefaultHasher;
2519- /// use std::hash::Hasher;
2519+ /// use std::hash::{Hash, Hasher} ;
25202520/// use std::ptr;
25212521///
25222522/// let five = 5;
25232523/// let five_ref = &five;
25242524///
25252525/// let mut hasher = DefaultHasher::new();
2526+ /// #[feature(ptr_hash)]
25262527/// ptr::hash(five_ref, &mut hasher);
25272528/// let actual = hasher.finish();
25282529///
25292530/// let mut hasher = DefaultHasher::new();
2530- /// (five_ref as *const T ).hash(&mut hasher);
2531+ /// (five_ref as *const i32 ).hash(&mut hasher);
25312532/// let expected = hasher.finish();
25322533///
25332534/// assert_eq!(actual, expected);
You can’t perform that action at this time.
0 commit comments