about summary refs log tree commit diff
path: root/src/libcore/container.rs
AgeCommit message (Collapse)AuthorLines
2013-05-10core: Use the new `for` protocolAlex Crichton-0/+53
2013-05-07Add pop() and swap() to the Map traitAlex Crichton-0/+8
2013-05-04Register snapshotsBrian Anderson-36/+0
2013-04-10core: changes in response to #5656Niko Matsakis-0/+36
2013-04-10Revert map.each to something which takes two parametersNiko Matsakis-0/+3
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-03-24expose find_mut in the Map traitDaniel Micay-1/+1
2013-03-24treemap: add a find_mut methodDaniel Micay-1/+4
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-14/+14
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-2/+2
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-1/+1
notation. rs=delifetiming
2013-03-13add the mutate_values method to the Map traitDaniel Micay-0/+3
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-6/+6
2013-03-06Add manual &self/ and &static/ and /&self declarations thatNiko Matsakis-1/+0
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-0/+1
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-02-07rm each method from the Map traitDaniel Micay-3/+0
the map types should implement BaseIter instead
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-3/+0
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-01-30librustc: Change `self` as a type to `Self` everywhere. r=brsonPatrick Walton-7/+7
2013-01-29add intersection and union to the Set traitDaniel Micay-0/+6
2013-01-29add difference and symmetric_difference to SetDaniel Micay-0/+6
2013-01-29add is_disjoint to the Set traitDaniel Micay-0/+4
2013-01-29add is_subset and is_superset to the Set traitDaniel Micay-0/+6
2013-01-23add find method to the core::container::Map traitDaniel Micay-0/+5
2013-01-22add a base Container traitDaniel Micay-1/+9
2013-01-22add a container::Map traitDaniel Micay-0/+26
2013-01-22add a Mutable container trait with clearDaniel Micay-1/+6
2013-01-20add a Set trait and implement it for TreeSetDaniel Micay-0/+24