about summary refs log tree commit diff
path: root/src/libstd/hash.rs
AgeCommit message (Collapse)AuthorLines
2014-11-26/*! -> //!Steve Klabnik-52/+50
Sister pull request of https://github.com/rust-lang/rust/pull/19288, but for the other style of block doc comment.
2014-10-31DSTify HashJorge Aparicio-1/+2
- 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]
2014-07-11mark std::hash experimentalAaron Turon-0/+2
The `hash` module was not included in an earlier pass that sets baseline stability of modules within `std` to `experimental`.
2014-07-01std: move the hash docstring over to std::hash.Erick Tryzelaar-1/+52
2014-06-30std: make sure HashMap from_iter uses random initialization by defaultErick Tryzelaar-0/+51
It turns out that HashMap's from_iter implementation was being initialized without the sip keys being randomized. This adds a custom default hasher that should avoid this potential vulnerability.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-506/+0
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-22Reduce reliance on `to_str_radix`Brendan Zabarauskas-3/+2
This is in preparation to remove the implementations of ToStrRadix in integers, and to remove the associated logic from `std::num::strconv`. The parts that still need to be liberated are: - `std::fmt::Formatter::runplural` - `num::{bigint, complex, rational}`
2014-02-03std: Remove io::io_errorAlex Crichton-9/+7
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
2014-01-21Remove unnecessary parentheses.Huon Wilson-1/+1
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-1/+2
2013-12-17Don't allow impls to force public typesAlex Crichton-0/+1
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
2013-12-11Make 'self lifetime illegal.Erik Price-2/+2
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-08Remove dead codesKiet Tran-101/+0
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-30/+30
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-1/+1
2013-11-11Move std::rt::io to std::ioAlex Crichton-1/+1
2013-10-27Clarify that the SipHash implementation has not be validated for ↵Palmer Cox-2/+7
cryptographic purposes.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-09-30std: Remove usage of fmt!Alex Crichton-3/+3
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-08-27Replace HashUtil w/ default method on HashJason Fager-7/+0
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-5/+3
2013-08-18std::hash: Add testcase for colliding hashes of tuplesblake2-ppc-0/+14
Add a testcase that verifies that (s, t) and (u, v) don't collide even if s + t == u + v (concatenation).
2013-08-18std::to_bytes: Delimit sequences &[A] and ~str when hashingblake2-ppc-1/+9
Address issue #5257, for example these values all had the same hash value: ("aaa", "bbb", "ccc") ("aaab", "bb", "ccc") ("aaabbb", "", "ccc") IterBytes for &[A] now includes the length, before calling iter_bytes on each element. IterBytes for &str is now terminated by a byte that does not appear in UTF-8. This way only one more byte is processed when hashing strings.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-01std: Use `do` blocks instead of `for` with .iter_bytes()blake2-ppc-30/+45
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-3/+4
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-3/+4
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-23vec: remove BaseIter implementationDaniel Micay-3/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-8/+8
2013-06-15Add IterBytes impls for float/f32/f64. This allows creatinggareth-0/+11
HashMaps with floats as keys.
2013-05-30Require documentation by default for libstdAlex Crichton-0/+2
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+2
2013-05-28Silence various warnings throughout test modulesAlex Crichton-1/+1
2013-05-23cleanup warnings from libstdErick Tryzelaar-1/+1
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+557
This only changes the directory names; it does not change the "real" metadata names.