about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/hash/mod.rs37
-rw-r--r--src/libcollections/hash/sip.rs2
-rw-r--r--src/libcore/cmp.rs3
-rw-r--r--src/libcore/slice.rs2
-rw-r--r--src/libcore/str.rs4
-rw-r--r--src/libregex/re.rs2
-rw-r--r--src/librustc/lint/context.rs8
-rw-r--r--src/librustc/metadata/creader.rs2
-rw-r--r--src/librustc/metadata/decoder.rs2
-rw-r--r--src/librustc/metadata/filesearch.rs4
-rw-r--r--src/librustc/metadata/loader.rs2
-rw-r--r--src/librustc/middle/trans/base.rs6
-rw-r--r--src/librustc/middle/trans/debuginfo.rs2
-rw-r--r--src/librustc/middle/trans/type_.rs2
-rw-r--r--src/librustc/util/nodemap.rs2
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/libstd/collections/hashmap/map.rs21
-rw-r--r--src/libstd/collections/hashmap/set.rs3
-rw-r--r--src/libstd/collections/hashmap/table.rs4
-rw-r--r--src/libstd/hash.rs3
-rw-r--r--src/libsyntax/diagnostics/registry.rs2
-rw-r--r--src/libsyntax/ext/format.rs6
-rw-r--r--src/libsyntax/util/interner.rs6
-rw-r--r--src/libterm/terminfo/mod.rs20
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs2
-rw-r--r--src/test/run-pass/send_str_hashmap.rs8
26 files changed, 83 insertions, 74 deletions
diff --git a/src/libcollections/hash/mod.rs b/src/libcollections/hash/mod.rs
index c59de19e822..6c1a4019bd8 100644
--- a/src/libcollections/hash/mod.rs
+++ b/src/libcollections/hash/mod.rs
@@ -80,7 +80,7 @@ pub mod sip;
 /// A hashable type. The `S` type parameter is an abstract hash state that is
 /// used by the `Hash` to compute the hash. It defaults to
 /// `std::hash::sip::SipState`.
-pub trait Hash<S = sip::SipState> {
+pub trait Hash<S = sip::SipState> for Sized? {
     /// Computes the hash of a value.
     fn hash(&self, state: &mut S);
 }
@@ -89,7 +89,7 @@ pub trait Hash<S = sip::SipState> {
 /// containers like `HashMap`, which need a generic way hash multiple types.
 pub trait Hasher<S> {
     /// Compute the hash of a value.
-    fn hash<T: Hash<S>>(&self, value: &T) -> u64;
+    fn hash<Sized? T: Hash<S>>(&self, value: &T) -> u64;
 }
 
 pub trait Writer {
@@ -137,7 +137,7 @@ impl<S: Writer> Hash<S> for char {
     }
 }
 
-impl<'a, S: Writer> Hash<S> for &'a str {
+impl<S: Writer> Hash<S> for str {
     #[inline]
     fn hash(&self, state: &mut S) {
         state.write(self.as_bytes());
@@ -186,7 +186,7 @@ impl_hash_tuple!(A B C D E F G H I J)
 impl_hash_tuple!(A B C D E F G H I J K)
 impl_hash_tuple!(A B C D E F G H I J K L)
 
-impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a [T] {
+impl<S: Writer, T: Hash<S>> Hash<S> for [T] {
     #[inline]
     fn hash(&self, state: &mut S) {
         self.len().hash(state);
@@ -197,13 +197,6 @@ impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a [T] {
 }
 
 
-impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a mut [T] {
-    #[inline]
-    fn hash(&self, state: &mut S) {
-        self.as_slice().hash(state);
-    }
-}
-
 impl<S: Writer, T: Hash<S>> Hash<S> for Vec<T> {
     #[inline]
     fn hash(&self, state: &mut S) {
@@ -211,27 +204,28 @@ impl<S: Writer, T: Hash<S>> Hash<S> for Vec<T> {
     }
 }
 
-impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a T {
+impl<'a, S: Writer, Sized? T: Hash<S>> Hash<S> for &'a T {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
     }
 }
 
-impl<'a, S: Writer, T: Hash<S>> Hash<S> for &'a mut T {
+impl<'a, S: Writer, Sized? T: Hash<S>> Hash<S> for &'a mut T {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
     }
 }
 
-impl<S: Writer, T: Hash<S>> Hash<S> for Box<T> {
+impl<S: Writer, Sized? T: Hash<S>> Hash<S> for Box<T> {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
     }
 }
 
+// FIXME (#18248) Make `T` `Sized?`
 impl<S: Writer, T: Hash<S>> Hash<S> for Rc<T> {
     #[inline]
     fn hash(&self, state: &mut S) {
@@ -293,6 +287,7 @@ impl<S: Writer, T: Hash<S>, U: Hash<S>> Hash<S> for Result<T, U> {
 
 #[cfg(test)]
 mod tests {
+    use core::kinds::Sized;
     use std::mem;
 
     use slice::ImmutableSlice;
@@ -301,7 +296,7 @@ mod tests {
     struct MyWriterHasher;
 
     impl Hasher<MyWriter> for MyWriterHasher {
-        fn hash<T: Hash<MyWriter>>(&self, value: &T) -> u64 {
+        fn hash<Sized? T: Hash<MyWriter>>(&self, value: &T) -> u64 {
             let mut state = MyWriter { hash: 0 };
             value.hash(&mut state);
             state.hash
@@ -323,6 +318,8 @@ mod tests {
 
     #[test]
     fn test_writer_hasher() {
+        use alloc::boxed::Box;
+
         let hasher = MyWriterHasher;
 
         assert_eq!(hasher.hash(&()), 0);
@@ -344,9 +341,17 @@ mod tests {
 
         assert_eq!(hasher.hash(&'a'), 97);
 
-        assert_eq!(hasher.hash(&("a")), 97 + 0xFF);
+        let s: &str = "a";
+        assert_eq!(hasher.hash(& s), 97 + 0xFF);
+        // FIXME (#18283) Enable test
+        //let s: Box<str> = box "a";
+        //assert_eq!(hasher.hash(& s), 97 + 0xFF);
         let cs: &[u8] = &[1u8, 2u8, 3u8];
         assert_eq!(hasher.hash(& cs), 9);
+        let cs: Box<[u8]> = box [1u8, 2u8, 3u8];
+        assert_eq!(hasher.hash(& cs), 9);
+
+        // FIXME (#18248) Add tests for hashing Rc<str> and Rc<[T]>
 
         unsafe {
             let ptr: *const int = mem::transmute(5i);
diff --git a/src/libcollections/hash/sip.rs b/src/libcollections/hash/sip.rs
index 4ac06a884a6..1f12065750b 100644
--- a/src/libcollections/hash/sip.rs
+++ b/src/libcollections/hash/sip.rs
@@ -235,7 +235,7 @@ impl SipHasher {
 
 impl Hasher<SipState> for SipHasher {
     #[inline]
-    fn hash<T: Hash<SipState>>(&self, value: &T) -> u64 {
+    fn hash<Sized? T: Hash<SipState>>(&self, value: &T) -> u64 {
         let mut state = SipState::new_with_keys(self.k0, self.k1);
         value.hash(&mut state);
         state.result()
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 505dc183480..d7c2b52b8de 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -39,6 +39,7 @@
 
 #![stable]
 
+use kinds::Sized;
 use option::{Option, Some, None};
 
 /// Trait for values that can be compared for equality and inequality.
@@ -236,7 +237,7 @@ pub trait PartialOrd: PartialEq {
 /// container types; e.g. it is often desirable to be able to use `&str`
 /// values to look up entries in a container with `String` keys.
 #[experimental = "Better solutions may be discovered."]
-pub trait Equiv<T> {
+pub trait Equiv<T> for Sized? {
     /// Implement this function to decide equivalent values.
     fn equiv(&self, other: &T) -> bool;
 }
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index aadf540afbe..dd51534d319 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -1565,7 +1565,7 @@ impl<'a,T:PartialEq> PartialEq for &'a [T] {
 impl<'a,T:Eq> Eq for &'a [T] {}
 
 #[unstable = "waiting for DST"]
-impl<'a,T:PartialEq, V: AsSlice<T>> Equiv<V> for &'a [T] {
+impl<T: PartialEq, V: AsSlice<T>> Equiv<V> for [T] {
     #[inline]
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
 }
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 433a3ce1109..86bbef861c4 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -1160,9 +1160,9 @@ pub mod traits {
         }
     }
 
-    impl<'a, S: Str> Equiv<S> for &'a str {
+    impl<S: Str> Equiv<S> for str {
         #[inline]
-        fn equiv(&self, other: &S) -> bool { eq_slice(*self, other.as_slice()) }
+        fn equiv(&self, other: &S) -> bool { eq_slice(self, other.as_slice()) }
     }
 
     impl ops::Slice<uint, str> for str {
diff --git a/src/libregex/re.rs b/src/libregex/re.rs
index d352739f853..08d73d3434f 100644
--- a/src/libregex/re.rs
+++ b/src/libregex/re.rs
@@ -724,7 +724,7 @@ impl<'t> Captures<'t> {
         match self.named {
             None => "",
             Some(ref h) => {
-                match h.find_equiv(&name) {
+                match h.find_equiv(name) {
                     None => "",
                     Some(i) => self.at(*i),
                 }
diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs
index aa8e1ed2703..a18d91196e0 100644
--- a/src/librustc/lint/context.rs
+++ b/src/librustc/lint/context.rs
@@ -164,7 +164,7 @@ impl LintStore {
     }
 
     fn register_renamed(&mut self, old_name: &str, new_name: &str) {
-        let target = match self.by_name.find_equiv(&new_name) {
+        let target = match self.by_name.find_equiv(new_name) {
             Some(&Id(lint_id)) => lint_id.clone(),
             _ => panic!("invalid lint renaming of {} to {}", old_name, new_name)
         };
@@ -258,7 +258,7 @@ impl LintStore {
     fn find_lint(&self, lint_name: &str, sess: &Session, span: Option<Span>)
                  -> Option<LintId>
     {
-        match self.by_name.find_equiv(&lint_name) {
+        match self.by_name.find_equiv(lint_name) {
             Some(&Id(lint_id)) => Some(lint_id),
             Some(&Renamed(ref new_name, lint_id)) => {
                 let warning = format!("lint {} has been renamed to {}",
@@ -280,7 +280,7 @@ impl LintStore {
                 None => {
                     match self.lint_groups.iter().map(|(&x, pair)| (x, pair.ref0().clone()))
                                                  .collect::<HashMap<&'static str, Vec<LintId>>>()
-                                                 .find_equiv(&lint_name.as_slice()) {
+                                                 .find_equiv(lint_name.as_slice()) {
                         Some(v) => {
                             v.iter()
                              .map(|lint_id: &LintId|
@@ -487,7 +487,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
                     match self.lints.find_lint(lint_name.get(), &self.tcx.sess, Some(span)) {
                         Some(lint_id) => vec![(lint_id, level, span)],
                         None => {
-                            match self.lints.lint_groups.find_equiv(&lint_name.get()) {
+                            match self.lints.lint_groups.find_equiv(lint_name.get()) {
                                 Some(&(ref v, _)) => v.iter()
                                                       .map(|lint_id: &LintId|
                                                            (*lint_id, level, span))
diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs
index 43d0156d727..92b2382ae64 100644
--- a/src/librustc/metadata/creader.rs
+++ b/src/librustc/metadata/creader.rs
@@ -303,7 +303,7 @@ fn existing_match(e: &Env, name: &str,
         // `source` stores paths which are normalized which may be different
         // from the strings on the command line.
         let source = e.sess.cstore.get_used_crate_source(cnum).unwrap();
-        match e.sess.opts.externs.find_equiv(&name) {
+        match e.sess.opts.externs.find_equiv(name) {
             Some(locs) => {
                 let found = locs.iter().any(|l| {
                     let l = fs::realpath(&Path::new(l.as_slice())).ok();
diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs
index e126449b248..22ebaa40eb2 100644
--- a/src/librustc/metadata/decoder.rs
+++ b/src/librustc/metadata/decoder.rs
@@ -295,7 +295,7 @@ fn item_path(item_doc: rbml::Doc) -> Vec<ast_map::PathElem> {
 fn item_name(intr: &IdentInterner, item: rbml::Doc) -> ast::Name {
     let name = reader::get_doc(item, tag_paths_data_name);
     let string = name.as_str_slice();
-    match intr.find_equiv(&string) {
+    match intr.find_equiv(string) {
         None => token::intern(string),
         Some(val) => val,
     }
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index 98ce6942d48..6d938b56303 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -52,7 +52,7 @@ impl<'a> FileSearch<'a> {
         debug!("filesearch: searching lib path");
         let tlib_path = make_target_lib_path(self.sysroot,
                                     self.triple);
-        if !visited_dirs.contains_equiv(&tlib_path.as_vec()) {
+        if !visited_dirs.contains_equiv(tlib_path.as_vec()) {
             match f(&tlib_path) {
                 FileMatches => found = true,
                 FileDoesntMatch => ()
@@ -69,7 +69,7 @@ impl<'a> FileSearch<'a> {
                 debug!("is {} in visited_dirs? {}", tlib_path.display(),
                         visited_dirs.contains_equiv(&tlib_path.as_vec().to_vec()));
 
-                if !visited_dirs.contains_equiv(&tlib_path.as_vec()) {
+                if !visited_dirs.contains_equiv(tlib_path.as_vec()) {
                     visited_dirs.insert(tlib_path.as_vec().to_vec());
                     // Don't keep searching the RUST_PATH if one match turns up --
                     // if we did, we'd get a "multiple matching crates" error
diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs
index 36e04d84aa9..623a763bd74 100644
--- a/src/librustc/metadata/loader.rs
+++ b/src/librustc/metadata/loader.rs
@@ -631,7 +631,7 @@ impl<'a> Context<'a> {
     }
 
     fn find_commandline_library(&mut self) -> Option<Library> {
-        let locs = match self.sess.opts.externs.find_equiv(&self.crate_name) {
+        let locs = match self.sess.opts.externs.find_equiv(self.crate_name) {
             Some(s) => s,
             None => return None,
         };
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index ae8f944cab1..e6a54c74cd2 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -224,7 +224,7 @@ pub fn get_extern_fn(ccx: &CrateContext,
                      ty: Type,
                      output: ty::t)
                      -> ValueRef {
-    match externs.find_equiv(&name) {
+    match externs.find_equiv(name) {
         Some(n) => return *n,
         None => {}
     }
@@ -234,7 +234,7 @@ pub fn get_extern_fn(ccx: &CrateContext,
 }
 
 fn get_extern_rust_fn(ccx: &CrateContext, fn_ty: ty::t, name: &str, did: ast::DefId) -> ValueRef {
-    match ccx.externs().borrow().find_equiv(&name) {
+    match ccx.externs().borrow().find_equiv(name) {
         Some(n) => return *n,
         None => ()
     }
@@ -2999,7 +2999,7 @@ fn internalize_symbols(cx: &SharedCrateContext, reachable: &HashSet<String>) {
 
                 let name = CString::new(llvm::LLVMGetValueName(val), false);
                 if !declared.contains(&name) &&
-                   !reachable.contains_equiv(&name.as_str().unwrap()) {
+                   !reachable.contains_equiv(name.as_str().unwrap()) {
                     llvm::SetLinkage(val, llvm::InternalLinkage);
                 }
             }
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index c688749a389..3d76d1f5d4d 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -1670,7 +1670,7 @@ fn declare_local(bcx: Block,
 }
 
 fn file_metadata(cx: &CrateContext, full_path: &str) -> DIFile {
-    match debug_context(cx).created_files.borrow().find_equiv(&full_path) {
+    match debug_context(cx).created_files.borrow().find_equiv(full_path) {
         Some(file_metadata) => return *file_metadata,
         None => ()
     }
diff --git a/src/librustc/middle/trans/type_.rs b/src/librustc/middle/trans/type_.rs
index 851552592dd..d8424c9f316 100644
--- a/src/librustc/middle/trans/type_.rs
+++ b/src/librustc/middle/trans/type_.rs
@@ -333,7 +333,7 @@ impl TypeNames {
     }
 
     pub fn find_type(&self, s: &str) -> Option<Type> {
-        self.named_types.borrow().find_equiv(&s).map(|x| Type::from_ref(*x))
+        self.named_types.borrow().find_equiv(s).map(|x| Type::from_ref(*x))
     }
 
     pub fn type_to_string(&self, ty: Type) -> String {
diff --git a/src/librustc/util/nodemap.rs b/src/librustc/util/nodemap.rs
index a38ee84e95d..75406eb29a9 100644
--- a/src/librustc/util/nodemap.rs
+++ b/src/librustc/util/nodemap.rs
@@ -74,7 +74,7 @@ pub struct FnvHasher;
 pub struct FnvState(u64);
 
 impl Hasher<FnvState> for FnvHasher {
-    fn hash<T: Hash<FnvState>>(&self, t: &T) -> u64 {
+    fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 {
         let mut state = FnvState(0xcbf29ce484222325);
         t.hash(&mut state);
         let FnvState(ret) = state;
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index b7dfd811574..d1d9702a134 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2123,7 +2123,7 @@ impl<'a> fmt::Show for Sidebar<'a> {
 
         fn block(w: &mut fmt::Formatter, short: &str, longty: &str,
                  cur: &clean::Item, cx: &Context) -> fmt::Result {
-            let items = match cx.sidebar.find_equiv(&short) {
+            let items = match cx.sidebar.find_equiv(short) {
                 Some(items) => items.as_slice(),
                 None => return Ok(())
             };
diff --git a/src/libstd/collections/hashmap/map.rs b/src/libstd/collections/hashmap/map.rs
index cb47c28f8be..881ffd21d71 100644
--- a/src/libstd/collections/hashmap/map.rs
+++ b/src/libstd/collections/hashmap/map.rs
@@ -17,6 +17,7 @@ use default::Default;
 use fmt::{mod, Show};
 use hash::{Hash, Hasher, RandomSipHasher};
 use iter::{mod, Iterator, FromIterator, Extendable};
+use kinds::Sized;
 use mem::{mod, replace};
 use num;
 use ops::{Deref, Index, IndexMut};
@@ -419,17 +420,17 @@ impl<K, V, M> SearchResult<K, V, M> {
 }
 
 impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
-    fn make_hash<X: Hash<S>>(&self, x: &X) -> SafeHash {
+    fn make_hash<Sized? X: Hash<S>>(&self, x: &X) -> SafeHash {
         table::make_hash(&self.hasher, x)
     }
 
-    fn search_equiv<'a, Q: Hash<S> + Equiv<K>>(&'a self, q: &Q)
+    fn search_equiv<'a, Sized? Q: Hash<S> + Equiv<K>>(&'a self, q: &Q)
                     -> Option<FullBucketImm<'a, K, V>> {
         let hash = self.make_hash(q);
         search_hashed_generic(&self.table, &hash, |k| q.equiv(k)).into_option()
     }
 
-    fn search_equiv_mut<'a, Q: Hash<S> + Equiv<K>>(&'a mut self, q: &Q)
+    fn search_equiv_mut<'a, Sized? Q: Hash<S> + Equiv<K>>(&'a mut self, q: &Q)
                     -> Option<FullBucketMut<'a, K, V>> {
         let hash = self.make_hash(q);
         search_hashed_generic(&mut self.table, &hash, |k| q.equiv(k)).into_option()
@@ -857,7 +858,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     /// using equivalence.
     ///
     /// See [pop_equiv](#method.pop_equiv) for an extended example.
-    pub fn contains_key_equiv<Q: Hash<S> + Equiv<K>>(&self, key: &Q) -> bool {
+    pub fn contains_key_equiv<Sized? Q: Hash<S> + Equiv<K>>(&self, key: &Q) -> bool {
         self.search_equiv(key).is_some()
     }
 
@@ -865,7 +866,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     /// equivalence.
     ///
     /// See [pop_equiv](#method.pop_equiv) for an extended example.
-    pub fn find_equiv<'a, Q: Hash<S> + Equiv<K>>(&'a self, k: &Q) -> Option<&'a V> {
+    pub fn find_equiv<'a, Sized? Q: Hash<S> + Equiv<K>>(&'a self, k: &Q) -> Option<&'a V> {
         match self.search_equiv(k) {
             None      => None,
             Some(bucket) => {
@@ -921,7 +922,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
     ///
     /// ```
     #[experimental]
-    pub fn pop_equiv<Q:Hash<S> + Equiv<K>>(&mut self, k: &Q) -> Option<V> {
+    pub fn pop_equiv<Sized? Q:Hash<S> + Equiv<K>>(&mut self, k: &Q) -> Option<V> {
         if self.table.size() == 0 {
             return None
         }
@@ -1879,11 +1880,11 @@ mod test_map {
         m.insert("baz".to_string(), baz);
 
 
-        assert_eq!(m.find_equiv(&("foo")), Some(&foo));
-        assert_eq!(m.find_equiv(&("bar")), Some(&bar));
-        assert_eq!(m.find_equiv(&("baz")), Some(&baz));
+        assert_eq!(m.find_equiv("foo"), Some(&foo));
+        assert_eq!(m.find_equiv("bar"), Some(&bar));
+        assert_eq!(m.find_equiv("baz"), Some(&baz));
 
-        assert_eq!(m.find_equiv(&("qux")), None);
+        assert_eq!(m.find_equiv("qux"), None);
     }
 
     #[test]
diff --git a/src/libstd/collections/hashmap/set.rs b/src/libstd/collections/hashmap/set.rs
index ca954679c1c..e4016c70320 100644
--- a/src/libstd/collections/hashmap/set.rs
+++ b/src/libstd/collections/hashmap/set.rs
@@ -13,6 +13,7 @@
 use clone::Clone;
 use cmp::{Eq, Equiv, PartialEq};
 use collections::{Collection, Mutable, Set, MutableSet, Map, MutableMap};
+use core::kinds::Sized;
 use default::Default;
 use fmt::Show;
 use fmt;
@@ -221,7 +222,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
     /// assert!(!set.contains_equiv(&EvenOrOdd { num: 2u }));
     ///
     /// ```
-    pub fn contains_equiv<Q: Hash<S> + Equiv<T>>(&self, value: &Q) -> bool {
+    pub fn contains_equiv<Sized? Q: Hash<S> + Equiv<T>>(&self, value: &Q) -> bool {
       self.map.contains_key_equiv(value)
     }
 
diff --git a/src/libstd/collections/hashmap/table.rs b/src/libstd/collections/hashmap/table.rs
index ca20c3ddb74..faff68c75ff 100644
--- a/src/libstd/collections/hashmap/table.rs
+++ b/src/libstd/collections/hashmap/table.rs
@@ -14,7 +14,7 @@ use clone::Clone;
 use cmp;
 use hash::{Hash, Hasher};
 use iter::{Iterator, count};
-use kinds::marker;
+use kinds::{Sized, marker};
 use mem::{min_align_of, size_of};
 use mem;
 use num::{CheckedAdd, CheckedMul, is_power_of_two};
@@ -131,7 +131,7 @@ impl SafeHash {
 /// We need to remove hashes of 0. That's reserved for empty buckets.
 /// This function wraps up `hash_keyed` to be the only way outside this
 /// module to generate a SafeHash.
-pub fn make_hash<T: Hash<S>, S, H: Hasher<S>>(hasher: &H, t: &T) -> SafeHash {
+pub fn make_hash<Sized? T: Hash<S>, S, H: Hasher<S>>(hasher: &H, t: &T) -> SafeHash {
     match hasher.hash(t) {
         // This constant is exceedingly likely to hash to the same
         // bucket, but it won't be counted as empty! Just so we can maintain
diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs
index 55d1411d77e..e4017ea5a47 100644
--- a/src/libstd/hash.rs
+++ b/src/libstd/hash.rs
@@ -65,6 +65,7 @@
 
 pub use core_collections::hash::{Hash, Hasher, Writer, hash, sip};
 
+use core::kinds::Sized;
 use default::Default;
 use rand::Rng;
 use rand;
@@ -91,7 +92,7 @@ impl RandomSipHasher {
 
 impl Hasher<sip::SipState> for RandomSipHasher {
     #[inline]
-    fn hash<T: Hash<sip::SipState>>(&self, value: &T) -> u64 {
+    fn hash<Sized? T: Hash<sip::SipState>>(&self, value: &T) -> u64 {
         self.hasher.hash(value)
     }
 }
diff --git a/src/libsyntax/diagnostics/registry.rs b/src/libsyntax/diagnostics/registry.rs
index 7bc191df55a..71d82a41f38 100644
--- a/src/libsyntax/diagnostics/registry.rs
+++ b/src/libsyntax/diagnostics/registry.rs
@@ -20,6 +20,6 @@ impl Registry {
     }
 
     pub fn find_description(&self, code: &str) -> Option<&'static str> {
-        self.descriptions.find_equiv(&code).map(|desc| *desc)
+        self.descriptions.find_equiv(code).map(|desc| *desc)
     }
 }
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index fa9a844233a..53d091db095 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -140,7 +140,7 @@ fn parse_args(ecx: &mut ExtCtxt, sp: Span, allow_method: bool,
             let name = interned_name.get();
             p.expect(&token::Eq);
             let e = p.parse_expr();
-            match names.find_equiv(&name) {
+            match names.find_equiv(name) {
                 None => {}
                 Some(prev) => {
                     ecx.span_err(e.span,
@@ -362,7 +362,7 @@ impl<'a, 'b> Context<'a, 'b> {
                 self.ecx.expr_path(path)
             }
             parse::CountIsName(n) => {
-                let i = match self.name_positions.find_equiv(&n) {
+                let i = match self.name_positions.find_equiv(n) {
                     Some(&i) => i,
                     None => 0, // error already emitted elsewhere
                 };
@@ -406,7 +406,7 @@ impl<'a, 'b> Context<'a, 'b> {
                     // Named arguments are converted to positional arguments at
                     // the end of the list of arguments
                     parse::ArgumentNamed(n) => {
-                        let i = match self.name_positions.find_equiv(&n) {
+                        let i = match self.name_positions.find_equiv(n) {
                             Some(&i) => i,
                             None => 0, // error already emitted elsewhere
                         };
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs
index ed2455d0a30..105118ff76a 100644
--- a/src/libsyntax/util/interner.rs
+++ b/src/libsyntax/util/interner.rs
@@ -75,7 +75,7 @@ impl<T: Eq + Hash + Clone + 'static> Interner<T> {
         (*vect).len()
     }
 
-    pub fn find_equiv<Q:Hash + Equiv<T>>(&self, val: &Q) -> Option<Name> {
+    pub fn find_equiv<Sized? Q: Hash + Equiv<T>>(&self, val: &Q) -> Option<Name> {
         let map = self.map.borrow();
         match (*map).find_equiv(val) {
             Some(v) => Some(*v),
@@ -149,7 +149,7 @@ impl StrInterner {
 
     pub fn intern(&self, val: &str) -> Name {
         let mut map = self.map.borrow_mut();
-        match map.find_equiv(&val) {
+        match map.find_equiv(val) {
             Some(&idx) => return idx,
             None => (),
         }
@@ -195,7 +195,7 @@ impl StrInterner {
         self.vect.borrow().len()
     }
 
-    pub fn find_equiv<Q:Hash + Equiv<RcStr>>(&self, val: &Q) -> Option<Name> {
+    pub fn find_equiv<Sized? Q:Hash + Equiv<RcStr>>(&self, val: &Q) -> Option<Name> {
         match (*self.map.borrow()).find_equiv(val) {
             Some(v) => Some(*v),
             None => None,
diff --git a/src/libterm/terminfo/mod.rs b/src/libterm/terminfo/mod.rs
index 73edcf94892..416be0e7050 100644
--- a/src/libterm/terminfo/mod.rs
+++ b/src/libterm/terminfo/mod.rs
@@ -78,7 +78,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> {
         if self.num_colors > color {
             let s = expand(self.ti
                                .strings
-                               .find_equiv(&("setaf"))
+                               .find_equiv("setaf")
                                .unwrap()
                                .as_slice(),
                            [Number(color as int)], &mut Variables::new());
@@ -95,7 +95,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> {
         if self.num_colors > color {
             let s = expand(self.ti
                                .strings
-                               .find_equiv(&("setab"))
+                               .find_equiv("setab")
                                .unwrap()
                                .as_slice(),
                            [Number(color as int)], &mut Variables::new());
@@ -113,7 +113,7 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> {
             attr::BackgroundColor(c) => self.bg(c),
             _ => {
                 let cap = cap_for_attr(attr);
-                let parm = self.ti.strings.find_equiv(&cap);
+                let parm = self.ti.strings.find_equiv(cap);
                 if parm.is_some() {
                     let s = expand(parm.unwrap().as_slice(),
                                    [],
@@ -135,19 +135,19 @@ impl<T: Writer+Send> Terminal<T> for TerminfoTerminal<T> {
             }
             _ => {
                 let cap = cap_for_attr(attr);
-                self.ti.strings.find_equiv(&cap).is_some()
+                self.ti.strings.find_equiv(cap).is_some()
             }
         }
     }
 
     fn reset(&mut self) -> IoResult<()> {
-        let mut cap = self.ti.strings.find_equiv(&("sgr0"));
+        let mut cap = self.ti.strings.find_equiv("sgr0");
         if cap.is_none() {
             // are there any terminals that have color/attrs and not sgr0?
             // Try falling back to sgr, then op
-            cap = self.ti.strings.find_equiv(&("sgr"));
+            cap = self.ti.strings.find_equiv("sgr");
             if cap.is_none() {
-                cap = self.ti.strings.find_equiv(&("op"));
+                cap = self.ti.strings.find_equiv("op");
             }
         }
         let s = cap.map_or(Err("can't find terminfo capability `sgr0`".to_string()), |op| {
@@ -202,9 +202,9 @@ impl<T: Writer+Send> TerminfoTerminal<T> {
         }
 
         let inf = ti.unwrap();
-        let nc = if inf.strings.find_equiv(&("setaf")).is_some()
-                 && inf.strings.find_equiv(&("setab")).is_some() {
-                     inf.numbers.find_equiv(&("colors")).map_or(0, |&n| n)
+        let nc = if inf.strings.find_equiv("setaf").is_some()
+                 && inf.strings.find_equiv("setab").is_some() {
+                     inf.numbers.find_equiv("colors").map_or(0, |&n| n)
                  } else { 0 };
 
         return Some(box TerminfoTerminal {out: out,
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 5d77e27f948..b1cc52791ab 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -75,7 +75,7 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , uint>, total: uint) -> String {
 // given a map, search for the frequency of a pattern
 fn find(mm: &HashMap<Vec<u8> , uint>, key: String) -> uint {
    let key = key.into_ascii().as_slice().to_lowercase().into_string();
-   match mm.find_equiv(&key.as_bytes()) {
+   match mm.find_equiv(key.as_bytes()) {
       option::None      => { return 0u; }
       option::Some(&num) => { return num; }
    }
diff --git a/src/test/run-pass/send_str_hashmap.rs b/src/test/run-pass/send_str_hashmap.rs
index 8b041ed3a3e..163cf194a3c 100644
--- a/src/test/run-pass/send_str_hashmap.rs
+++ b/src/test/run-pass/send_str_hashmap.rs
@@ -49,10 +49,10 @@ pub fn main() {
     assert!(!map.insert(Owned("cde".to_string()), c));
     assert!(!map.insert(Slice("def"), d));
 
-    assert_eq!(map.find_equiv(&("abc")), Some(&a));
-    assert_eq!(map.find_equiv(&("bcd")), Some(&b));
-    assert_eq!(map.find_equiv(&("cde")), Some(&c));
-    assert_eq!(map.find_equiv(&("def")), Some(&d));
+    assert_eq!(map.find_equiv("abc"), Some(&a));
+    assert_eq!(map.find_equiv("bcd"), Some(&b));
+    assert_eq!(map.find_equiv("cde"), Some(&c));
+    assert_eq!(map.find_equiv("def"), Some(&d));
 
     assert_eq!(map.find_equiv(&Slice("abc")), Some(&a));
     assert_eq!(map.find_equiv(&Slice("bcd")), Some(&b));