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 {
2516
2516
///
2517
2517
/// ```
2518
2518
/// use std::collections::hash_map::DefaultHasher;
2519
- /// use std::hash::Hasher;
2519
+ /// use std::hash::{Hash, Hasher} ;
2520
2520
/// use std::ptr;
2521
2521
///
2522
2522
/// let five = 5;
2523
2523
/// let five_ref = &five;
2524
2524
///
2525
2525
/// let mut hasher = DefaultHasher::new();
2526
+ /// #[feature(ptr_hash)]
2526
2527
/// ptr::hash(five_ref, &mut hasher);
2527
2528
/// let actual = hasher.finish();
2528
2529
///
2529
2530
/// let mut hasher = DefaultHasher::new();
2530
- /// (five_ref as *const T ).hash(&mut hasher);
2531
+ /// (five_ref as *const i32 ).hash(&mut hasher);
2531
2532
/// let expected = hasher.finish();
2532
2533
///
2533
2534
/// assert_eq!(actual, expected);
You can’t perform that action at this time.
0 commit comments