about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2014-11-16rollup merge of #18976: bjz/rfc369-numericsJakub Bukaj-2/+59
2014-11-16rollup merge of #18970: aturon/fixup-stableJakub Bukaj-1/+0
2014-11-16rollup merge of #18942: jbcrail/tree-set-docsJakub Bukaj-4/+4
2014-11-16Move ToString to collections::stringBrendan Zabarauskas-1/+44
This also impls `FormatWriter` for `Vec<u8>`
2014-11-16Move IntoString to collections::stringBrendan Zabarauskas-0/+6
2014-11-16Move FromStr to core::strBrendan Zabarauskas-1/+9
2014-11-15Update ring_buf.rs from fallout of #18827.Colin Sherratt-5/+5
2014-11-14libs: fix #[stable] inheritance falloutAaron Turon-1/+0
A recent change turned off inheritance for the #[stable] by default, but failed to catch all the cases where this was being used in std. This patch fixes that problem.
2014-11-14auto merge of #18880 : barosl/rust/doc-fail-to-panic, r=alexcrichtonbors-19/+19
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-14Added population count assertion in reserve. Cleaned up wrap_index.Colin Sherratt-11/+14
2014-11-14Manually reset the ringbuffer before or after the ringbuffer push/pop tests.Colin Sherratt-17/+25
2014-11-14Added some extra debug_asserts to ring_buf.Colin Sherratt-4/+16
2014-11-14Handle allocate/reallocate errors in ring_bufColin Sherratt-9/+14
Use is_some() in clear to simplify the clear loop.
2014-11-14Expand the benchmarking and unit test suite for ring_buf.Colin Sherratt-199/+486
-Adds unit tests for fn get() and fn get_mut() which are currently untested -Adds unit tests to verify growth of the ringbuffer when reserve is called. -Adds unit tests to confirm that dropping of items is correct Move ringbuf to use a raw buffer instead of Option<T>
2014-11-14auto merge of #18827 : bjz/rust/rfc369-numerics, r=alexcrichtonbors-7/+11
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-14Revert the need for initial values with arithmetic iteratorsBrendan Zabarauskas-4/+4
2014-11-13Remove BTreeSet from all examples.Joseph Crail-4/+4
2014-11-12Fix `Vec::map_in_place` not doing what is written in the commentTobias Bucher-1/+4
2014-11-12Register new snapshotsAlex Crichton-21/+0
2014-11-13Remove lots of numeric traits from the preludesBrendan Zabarauskas-1/+5
Num, NumCast, Unsigned, Float, Primitive and Int have been removed.
2014-11-13Deprecate Zero and One traitsBrendan Zabarauskas-4/+4
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-5/+5
2014-11-13Create UnsignedInt trait and deprecate free functionsBrendan Zabarauskas-2/+2
2014-11-12Fix remaining documentation to reflect fail!() -> panic!()Barosl Lee-19/+19
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-11auto merge of #18753 : jbcrail/rust/fix-deprecated-enum-set, r=alexcrichtonbors-2/+2
I renamed the deprecated methods, resulting from the collection reform.
2014-11-10Implement collection views API for TrieMap.Michael Sproul-102/+589
2014-11-09auto merge of #18756 : jbcrail/rust/add-enum-set-bitxor, r=alexcrichtonbors-1/+26
I implemented BitXor, and also added tests for BitAnd and BitXor. cc #18424
2014-11-08auto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichtonbors-16/+32
Ensured that Extend & FromIterator are implemented for the libcollection. Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache). Changed the name from Extend to Extendable. Part of #18424
2014-11-08auto merge of #18740 : jbcrail/rust/implement-enum-set-len, r=alexcrichtonbors-1/+20
This commit adds the missing EnumSet method mentioned by @Gankro. cc #18424
2014-11-08auto merge of #18735 : ↵bors-6/+5
utkarshkukreti/rust/remove-unnecessary-to_string-from-vec-docs, r=huonw I don't think they're needed.
2014-11-08Implements Extend for EnumSet and LruCachegamazeps-0/+16
Part of #18424
2014-11-08Renamed Extendable to Extendgamazeps-16/+16
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-07Add tests for BitAnd and BitXor.Joseph Crail-0/+20
2014-11-07Add BitXor to EnumSet.Joseph Crail-1/+6
2014-11-07Rename deprecated EnumSet methods in unit tests.Joseph Crail-2/+2
2014-11-07Implement len() for EnumSet.Joseph Crail-1/+20
2014-11-07Remove unnecessary `.to_string()`s from `Vec.swap_remove`'s doc example.Utkarsh Kukreti-6/+5
2014-11-06Add example impl in CLike docs. Fix 13752.Simon Sapin-1/+21
2014-11-06EnumSet assertion: better error message.Simon Sapin-1/+3
2014-11-06Make EnumSet not silently corrupt data.Simon Sapin-1/+30
Assert at run time instead. Fixes #13756. I’d rather have this be detected at compile-time, but I don’t know how to do that.
2014-11-06fix EnumSet::is_subsetAlex Crichton-2/+7
Fix by @Gankro!
2014-11-06rollup merge of #18605 : Gankro/collect-fruitAlex Crichton-845/+1158
2014-11-06Implement low-hanging fruit of collection conventionsAlexis Beingessner-845/+1158
* 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-170/+72
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 testsJorge Aparicio-17/+17
2014-11-05Fix fallout of DSTifying PartialEq, PartialOrd, Eq, OrdJorge Aparicio-0/+21
2014-11-05Add impls of the comparison operators for fixed-length arrays of lengths ↵Niko Matsakis-10/+10
0...32 and repair various cases where slices and fixed-length arrays were being compared.
2014-11-05Repair various cases where values of distinct types were being operatedNiko Matsakis-1/+1
upon (e.g., `&int` added to `int`).
2014-11-04libsyntax: Forbid escapes in the inclusive range `\x80`-`\xff` inPatrick Walton-7/+8
Unicode characters and strings. Use `\u0080`-`\u00ff` instead. ASCII/byte literals are unaffected. This PR introduces a new function, `escape_default`, into the ASCII module. This was necessary for the pretty printer to continue to function. RFC #326. Closes #18062. [breaking-change]
2014-11-03rollup merge of #18519 : Gankro/collect-smashAlex Crichton-1620/+1715