Rollup merge of #56751 - mbrubeck:hash, r=dtolnay

Allow ptr::hash to accept fat pointers

Fat pointers implement Hash since #45483.  This is a follow-up to #56250.
This commit is contained in:
Pietro Albini 2018-12-15 10:17:35 +01:00 committed by GitHub
commit 7c83737b44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2544,7 +2544,7 @@ pub fn eq<T: ?Sized>(a: *const T, b: *const T) -> bool {
/// assert_eq!(actual, expected);
/// ```
#[unstable(feature = "ptr_hash", reason = "newly added", issue = "56286")]
pub fn hash<T, S: hash::Hasher>(hashee: *const T, into: &mut S) {
pub fn hash<T: ?Sized, S: hash::Hasher>(hashee: *const T, into: &mut S) {
use hash::Hash;
hashee.hash(into);
}