Move hash module from collections to core
This commit is contained in:
@@ -147,6 +147,7 @@ use core::clone::Clone;
|
||||
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
|
||||
use core::default::Default;
|
||||
use core::fmt;
|
||||
use core::hash::{mod, Hash};
|
||||
use core::kinds::marker;
|
||||
use core::mem::{transmute, min_align_of, size_of, forget};
|
||||
use core::ops::{Deref, Drop};
|
||||
@@ -594,6 +595,14 @@ impl<T: Ord> Ord for Rc<T> {
|
||||
fn cmp(&self, other: &Rc<T>) -> Ordering { (**self).cmp(&**other) }
|
||||
}
|
||||
|
||||
// FIXME (#18248) Make `T` `Sized?`
|
||||
impl<S: hash::Writer, T: Hash<S>> Hash<S> for Rc<T> {
|
||||
#[inline]
|
||||
fn hash(&self, state: &mut S) {
|
||||
(**self).hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
#[experimental = "Show is experimental."]
|
||||
impl<T: fmt::Show> fmt::Show for Rc<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user