about summary refs log tree commit diff
path: root/src/libcore/hashmap.rs
AgeCommit message (Collapse)AuthorLines
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-8/+8
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-10Stop using the '<->' operatorAlex Crichton-16/+8
2013-05-10core: Use the new `for` protocolAlex Crichton-9/+99
2013-05-08libcore: Remove mutable fields from rand.Patrick Walton-1/+1
2013-05-07auto merge of #6292 : thestinger/rust/cleanup, r=brsonbors-3/+75
2013-05-07Add pop() and swap() to the Map traitAlex Crichton-35/+30
2013-05-06remove borrowck workarounds from the containersDaniel Micay-3/+75
2013-05-05Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freezeNiko Matsakis-2/+2
Conflicts: src/libcore/core.rc src/libcore/hashmap.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/num/float.rs src/libcore/num/int-template.rs src/libcore/num/num.rs src/libcore/num/strconv.rs src/libcore/num/uint-template.rs src/libcore/ops.rs src/libcore/os.rs src/libcore/prelude.rs src/libcore/rt/mod.rs src/libcore/unstable/lang.rs src/librustc/driver/session.rs src/librustc/middle/astencode.rs src/librustc/middle/borrowck/check_loans.rs src/librustc/middle/borrowck/gather_loans.rs src/librustc/middle/borrowck/loan.rs src/librustc/middle/borrowck/preserve.rs src/librustc/middle/liveness.rs src/librustc/middle/mem_categorization.rs src/librustc/middle/region.rs src/librustc/middle/trans/base.rs src/librustc/middle/trans/inline.rs src/librustc/middle/trans/reachable.rs src/librustc/middle/typeck/check/_match.rs src/librustc/middle/typeck/check/regionck.rs src/librustc/util/ppaux.rs src/libstd/arena.rs src/libstd/ebml.rs src/libstd/json.rs src/libstd/serialize.rs src/libstd/std.rc src/libsyntax/ast_map.rs src/libsyntax/parse/parser.rs src/test/compile-fail/borrowck-uniq-via-box.rs src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs src/test/run-pass/borrowck-nested-calls.rs
2013-05-05add warning for #6248 and remove instances of itNiko Matsakis-0/+13
2013-05-04Register snapshotsBrian Anderson-168/+0
2013-05-02mod items need to be marked with `cfg(test)` not `test`.Felix S. Klock II-2/+2
2013-04-30adapt to snapshotNiko Matsakis-168/+0
2013-04-28make way for a new iter moduleDaniel Micay-4/+4
2013-04-24libcore: unify `gen_<type>` methods on `rand::RngUtil` into the generic `gen`.Huon Wilson-1/+1
This moves all the basic random value generation into the Rand instances for each type and then removes the `gen_int`, `gen_char` (etc) methods on RngUtil, leaving only the generic `gen` and the more specialised methods. Also, removes some imports that are redundant due to a `use core::prelude::*` statement.
2013-04-24libcore: remove @Rng from rand, and use traits instead.Huon Wilson-1/+1
Also, rename RandRes -> IsaacRng, and make the constructors static methods.
2013-04-19librustc: WIP patch for using the return value.Patrick Walton-23/+17
2013-04-16libcore,std,syntax,rustc: move tests into `mod tests`, make them private (no ↵Huon Wilson-14/+14
pub mod or pub fn).
2013-04-10core: changes in response to #5656Niko Matsakis-2/+171
2013-04-10Revert map.each to something which takes two parametersNiko Matsakis-23/+16
rather than a tuple. The current setup iterates over `BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared *in the each method*. You can't place such a type in the impl declaration. The compiler currently allows it, but this will not be legal under #5656 and I'm pretty sure it's not sound now.
2013-04-03rename Linear{Map,Set} => Hash{Map,Set}Daniel Micay-67/+67
2013-04-03hashmap: rm linear namespaceDaniel Micay-852/+848
2013-03-29Merge remote-tracking branch 'remotes/origin/incoming' into serialErick Tryzelaar-143/+143
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-143/+143
2013-03-29Merge remote-tracking branch 'remotes/origin/incoming' into serialErick Tryzelaar-2/+2
2013-03-29core: add LinearMap::with_capacityErick Tryzelaar-3/+17
2013-03-28Removing unused importsAlex Crichton-2/+2
2013-03-27hashmap: improve docstringDaniel Micay-1/+4
2013-03-26librustc: Modify all code to use new lifetime binder syntaxPatrick Walton-4/+3
2013-03-26syntax: Removing uses of HashMapAlex Crichton-0/+5
2013-03-24expose find_mut in the Map traitDaniel Micay-11/+11
2013-03-24hashmap: add find_mut methodDaniel Micay-1/+34
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-1/+1
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-58/+49
2013-03-22librustc: Remove all uses of `static` from functions. rs=destaticPatrick Walton-2/+2
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-4/+4
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-18librustc: Convert all uses of old lifetime notation to new lifetime ↵Patrick Walton-8/+8
notation. rs=delifetiming
2013-03-14auto merge of #5365 : thestinger/rust/map, r=catamorphismbors-0/+13
2013-03-13librustc: Don't accept `as Trait` anymore; fix all occurrences of it.Patrick Walton-0/+1
2013-03-13add the mutate_values method to the Map traitDaniel Micay-0/+13
2013-03-11libsyntax: Stop parsing bare functions in preparation for switching them overPatrick Walton-1/+3
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-12/+12
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-140/+140
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-1/+3
are currently inferred. New rules are coming that will require them to be explicit. All add some explicit self declarations.
2013-03-05libcore: Implement an `Equiv` trait and use it on hashmaps.Patrick Walton-1/+50
7.3x speedup in string map search speed on a microbenchmark of pure hashmap searching against a constant string, due to the lack of allocations. I ran into a few snags. 1. The way the coherence check is set up, I can't implement `Equiv<@str>` and `Equiv<~str>` for `&str` simultaneously. 2. I wanted to implement `Equiv<T>` for all `T:Eq` (i.e. every type can be compared to itself if it implements `Eq`), but the coherence check didn't like that either. 3. I couldn't add this to the `Map` trait because `LinearMap` needs special handling for its `Q` type parameter: it must not only implement `Equiv<T>` but also `Hash` and `Eq`. 4. `find_equiv(&&"foo")` doesn't parse, because of the double ampersand. It has to be written `find_equiv(& &"foo")`. We can probably just fix this. Nevertheless, this is a huge win; it should address a major source of performance problems, including the one here: http://maniagnosis.crsr.net/2013/02/creating-letterpress-cheating-program.html
2013-03-04Remove unused imports throughout src/Alex Crichton-3/+0
2013-03-02make LinearMap fields privateDaniel Micay-313/+313
Closes #4764
2013-02-28Fix implicit leaks of imports throughout librariesAlex Crichton-7/+6
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
2013-02-20librustc: Separate most trait bounds with '+'. rs=plussingPatrick Walton-15/+15
2013-02-15add reserve_at_least method to LinearMap/LinearSetDaniel Micay-4/+25
2013-02-15rm FIXME from LinearMap's to_bucketDaniel Micay-4/+2
There are no more poor hash functions left in the codebase, and it makes sense to rely on there being a good hash function thanks to the inclusion of SipHash and the ease of using it with custom types. Closes #3041