]> git.lizzy.rs Git - rust.git/commit
DSTify Hash
authorJorge Aparicio <japaricious@gmail.com>
Fri, 24 Oct 2014 17:25:50 +0000 (12:25 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Fri, 31 Oct 2014 12:25:34 +0000 (07:25 -0500)
commit1384a43db3a8b1551bfc3c6feb37e2174d4c2ba0
treee45a0343003c22ed5b1ccbaa008189db578c3658
parent065caf34f5ff29e04605f95d9c5d511af219439a
DSTify Hash

- The signature of the `*_equiv` methods of `HashMap` and similar structures
have changed, and now require one less level of indirection. Change your code
from:

```
hashmap.find_equiv(&"Hello");
hashmap.find_equiv(&&[0u8, 1, 2]);
```

to:

```
hashmap.find_equiv("Hello");
hashmap.find_equiv(&[0u8, 1, 2]);
```

- The generic parameter `T` of the `Hasher::hash<T>` method have become
`Sized?`. Downstream code must add `Sized?` to that method in their
implementations. For example:

```
impl Hasher<FnvState> for FnvHasher {
    fn hash<T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ }
}
```

must be changed to:

```
impl Hasher<FnvState> for FnvHasher {
    fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ }
    //      ^^^^^^
}
```

[breaking-change]
26 files changed:
src/libcollections/hash/mod.rs
src/libcollections/hash/sip.rs
src/libcore/cmp.rs
src/libcore/slice.rs
src/libcore/str.rs
src/libregex/re.rs
src/librustc/lint/context.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/metadata/loader.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/type_.rs
src/librustc/util/nodemap.rs
src/librustdoc/html/render.rs
src/libstd/collections/hashmap/map.rs
src/libstd/collections/hashmap/set.rs
src/libstd/collections/hashmap/table.rs
src/libstd/hash.rs
src/libsyntax/diagnostics/registry.rs
src/libsyntax/ext/format.rs
src/libsyntax/util/interner.rs
src/libterm/terminfo/mod.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/run-pass/send_str_hashmap.rs