about summary refs log tree commit diff
path: root/src/libstd/collections/hash
AgeCommit message (Collapse)AuthorLines
2014-11-26rollup merge of #19301: Gankro/take-fixAlex Crichton-1/+35
Was taking the value out correctly, but then not doing anything to actually fix the table. derp.
2014-11-25Fallout from stabilizationAaron Turon-4/+4
2014-11-25Make HashMap::take not corrupt the map. Fixes #19292Alexis Beingessner-1/+35
2014-11-23std: Add a new top-level thread_local moduleAlex Crichton-61/+72
This commit removes the `std::local_data` module in favor of a new `std::thread_local` module providing thread local storage. The module provides two variants of TLS: one which owns its contents and one which is based on scoped references. Each implementation has pros and cons listed in the documentation. Both flavors have accessors through a function called `with` which yield a reference to a closure provided. Both flavors also panic if a reference cannot be yielded and provide a function to test whether an access would panic or not. This is an implementation of [RFC 461][rfc] and full details can be found in that RFC. This is a breaking change due to the removal of the `std::local_data` module. All users can migrate to the new thread local system like so: thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None))) The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as an implementation detail which must now be explicitly stated by users. [rfc]: https://github.com/rust-lang/rfcs/pull/461 [breaking-change]
2014-11-18rollup merge of #19038: jayelm/fixed-typosJakub Bukaj-1/+1
Baby steps here... Fixed some comments in liblog, libregex, librustc, libstd.
2014-11-17Fix several typos in commentsjmu303-1/+1
liblog, libregex, librustc, libstd
2014-11-17Fallout from deprecationAaron Turon-4/+4
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-11-17libstd: Deprecate _equiv methodsAaron Turon-123/+84
This commit deprecates the `_equiv` family of methods on `HashMap` and `HashSet` by instead generalizing the "normal" methods like `get` and `remove` to use the new `std::borrow` infrastructure. [breaking-change]
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+6
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-1/+1
2014-11-16Deprecate hashmap's find_copy and get_copy in favour of cloned and cloneAlexis Beingessner-25/+7
2014-11-14auto merge of #18880 : barosl/rust/doc-fail-to-panic, r=alexcrichtonbors-4/+4
I found some occurrences of "failure" and "fails" in the documentation. I changed them to "panics" if it means a task panic. Otherwise I left it as is, or changed it to "errors" to clearly distinguish them. Also, I made a minor fix that is breaking the layout of a module page. "Example" is shown in an irrelevant place from the following page: http://doc.rust-lang.org/std/os/index.html
2014-11-14auto merge of #18827 : bjz/rust/rfc369-numerics, r=alexcrichtonbors-10/+9
This implements a considerable portion of rust-lang/rfcs#369 (tracked in #18640). Some interpretations had to be made in order to get this to work. The breaking changes are listed below: [breaking-change] - `core::num::{Num, Unsigned, Primitive}` have been deprecated and their re-exports removed from the `{std, core}::prelude`. - `core::num::{Zero, One, Bounded}` have been deprecated. Use the static methods on `core::num::{Float, Int}` instead. There is no equivalent to `Zero::is_zero`. Use `(==)` with `{Float, Int}::zero` instead. - `Signed::abs_sub` has been moved to `std::num::FloatMath`, and is no longer implemented for signed integers. - `core::num::Signed` has been removed, and its methods have been moved to `core::num::Float` and a new trait, `core::num::SignedInt`. The methods now take the `self` parameter by value. - `core::num::{Saturating, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv}` have been removed, and their methods moved to `core::num::Int`. Their parameters are now taken by value. This means that - `std::time::Duration` no longer implements `core::num::{Zero, CheckedAdd, CheckedSub}` instead defining the required methods non-polymorphically. - `core::num::{zero, one, abs, signum}` have been deprecated. Use their respective methods instead. - The `core::num::{next_power_of_two, is_power_of_two, checked_next_power_of_two}` functions have been deprecated in favor of methods defined a new trait, `core::num::UnsignedInt` - `core::iter::{AdditiveIterator, MultiplicativeIterator}` are now only implemented for the built-in numeric types. - `core::iter::{range, range_inclusive, range_step, range_step_inclusive}` now require `core::num::Int` to be implemented for the type they a re parametrized over.
2014-11-12Register new snapshotsAlex Crichton-23/+0
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-4/+4
2014-11-13Create UnsignedInt trait and deprecate free functionsBrendan Zabarauskas-7/+6
2014-11-12Fix remaining documentation to reflect fail!() -> panic!()Barosl Lee-4/+4
Throughout the docs, "failure" was replaced with "panics" if it means a task panic. Otherwise, it remained as is, or changed to "errors" to clearly differentiate it from a task panic.
2014-11-08Renamed Extendable to Extendgamazeps-4/+4
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-07auto merge of #18714 : nikomatsakis/rust/issue-18621-deref-for-refs, r=aturonbors-0/+4
libs: add Deref, DerefMut impls for references, fixing a bug in compiler in the process that was blocking this. r? @aturon
2014-11-06libs: add Deref, DerefMut impls for references, fixing a bug in compiler in ↵Niko Matsakis-0/+4
the process that was blocking this. Fixes #18621.
2014-11-06rollup merge of #18665 : scribu/patch-1Alex Crichton-1/+1
2014-11-06rollup merge of #18605 : Gankro/collect-fruitAlex Crichton-157/+136
2014-11-06Implement low-hanging fruit of collection conventionsAlexis Beingessner-157/+136
* Renames/deprecates the simplest and most obvious methods * Adds FIXME(conventions)s for outstanding work * Marks "handled" methods as unstable NOTE: the semantics of reserve and reserve_exact have changed! Other methods have had their semantics changed as well, but in a way that should obviously not typecheck if used incorrectly. Lots of work and breakage to come, but this handles most of the core APIs and most eggregious breakage. Future changes should *mostly* focus on niche collections, APIs, or simply back-compat additions. [breaking-change]
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-1/+1
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
2014-11-05Fix example in HashMap::new() docsCristi Burcă-1/+1
2014-11-05Add impls of the comparison operators for fixed-length arrays of lengths ↵Niko Matsakis-1/+1
0...32 and repair various cases where slices and fixed-length arrays were being compared.
2014-11-03std: Fix fallout of changing `#[deriving(Clone)]`Jorge Aparicio-1/+0
2014-11-02refactor libcollections as part of collection reformAlexis Beingessner-0/+4020
* Moves multi-collection files into their own directory, and splits them into seperate files * Changes exports so that each collection has its own module * Adds underscores to public modules and filenames to match standard naming conventions (that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet) * Renames PriorityQueue to BinaryHeap * Renames SmallIntMap to VecMap * Miscellanious fallout fixes [breaking-change]