about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-01-26Add examples to documentation of SliceExt methodsCarol Nichols-3/+104
2015-01-26Merge remote-tracking branch 'rust-lang/master'Brian Anderson-1/+17
Conflicts: src/librustc/lint/builtin.rs src/librustc/lint/context.rs
2015-01-26add split_off method to vec with testsJeff Belgum-2/+46
2015-01-26Auto merge of #21401 - kballard:optimize-shrink-to-fit, r=nikomatsakisbors-1/+17
Don't reallocate when capacity is already equal to length `Vec::shrink_to_fit()` may be called on vectors that are already the correct length. Calling out to `reallocate()` in this case is a bad idea because there is no guarantee that `reallocate()` won't allocate a new buffer anyway, and based on performance seen in external benchmarks, it seems likely that it is in fact reallocating a new buffer. Before: test string::tests::bench_exact_size_shrink_to_fit ... bench: 45 ns/iter (+/- 2) After: test string::tests::bench_exact_size_shrink_to_fit ... bench: 26 ns/iter (+/- 1)
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-175/+155
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-24str: make replace() example more simpleTshepang Lekhonkhobe-5/+2
2015-01-23grandfathered -> rust1Brian Anderson-490/+490
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-1/+3
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-23Set unstable feature names appropriatelyBrian Anderson-137/+140
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-22Rollup merge of #21484 - steveklabnik:connect_docs, r=alexcrichtonSteve Klabnik-2/+21
2015-01-22Put #[staged_api] behind the 'staged_api' gateBrian Anderson-0/+1
2015-01-21Remove 'since' from unstable attributesBrian Anderson-136/+136
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-627/+720
2015-01-21add doc examples for connect/concatSteve Klabnik-2/+21
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-119/+66
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-47/+48
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21437: FlaPer87/snapshotAlex Crichton-3/+0
r? @alexcrichton
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-3/+3
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21rollup merge of #21354: eddyb/vec-ufcsAlex Crichton-8/+8
There are two limitations to the macro that this addresses: 1. the expected type is not propagated, coercions don't trigger 2. references inside element expressions don't outlive the `Vec` Both of these limitations are caused by the block in the macro expansion, previously needed to trigger a coercion from `Box<[T; N]>` to `Box<[T]>`, now possible with UFCS.
2015-01-21rollup merge of #21053: apasel422/exactAlex Crichton-0/+7
2015-01-21Fallout from stabilization.Aaron Turon-23/+28
2015-01-21Deprecate slicing methods in favor of notationAaron Turon-94/+28
This commit deprecates `slice`, `slice_from`, `slice_to` and their mutable variants in favor of slice notation. The `as_slice` methods are left intact, for now. [breaking-change]
2015-01-21Stabilize Index traits and most range notationAaron Turon-2/+10
This commit marks as `#[stable]`: * The `Index` and `IndexMut` traits. These are stabilized as taking the index itself *by reference*; after extensive discussion it was determined that this is a better match with our choices elsewhere (e.g. making comparison operators auto-reference), and that the use cases for by-value indices are better handled through `IndexSet`. * The `Range`, `RangeFrom` and `RangeTo` structs, introduced for range notation. * Various impls of `Index` and `IndexMut`. The `FullRange` struct is left unstable as we may wish to rename it to `RangeFull` in the future. This commit also *removes* the `Step` trait in favor of direct implementation of iterator traits on ranges for integers. The `Step` trait was not a terribly useful factoring internally, and it is likely that external integer types are best off implementing range iterators directly. It was removed to simplify the API surface. We can always reintroduce `Step` later if it turns out to be useful. Due to this removal, this is a: [breaking-change]
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-47/+48
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20implement `ExactSizeIterator` for `slice::{Chunks,ChunksMut}`Andrew Paseltiner-0/+7
2015-01-20Register snapshot for 9006c3cFlavio Percoco-3/+0
2015-01-21Rollup merge of #21388 - aochagavia:collections, r=GankroBarosl LEE-11/+71
**Breaking change**: `VecMap::into_iter` now consumes the `VecMap`. To fix it you should pass the VecMap by value instead of by reference. [breaking-change] r? @Gankro
2015-01-21Rollup merge of #21375 - petrochenkov:ssbsl, r=alexcrichtonBarosl LEE-13/+13
After PR #19766 added implicit coersions `*mut T -> *const T`, the explicit casts can be removed. (The number of such casts turned out to be relatively small).
2015-01-21Rollup merge of #20998 - estsauver:20984, r=steveklabnikBarosl LEE-4/+4
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. If someone could look at src/etc/generate-deriving-span-tests.py, I'm not sure how those tests were passing before/if they were.
2015-01-19Don't reallocate when capacity is already equal to lengthKevin Ballard-1/+1
`Vec::shrink_to_fit()` may be called on vectors that are already the correct length. Calling out to `reallocate()` in this case is a bad idea because there is no guarantee that `reallocate()` won't allocate a new buffer anyway, and based on performance seen in external benchmarks, it seems likely that it is in fact reallocating a new buffer. Before: test string::tests::bench_exact_size_shrink_to_fit ... bench: 45 ns/iter (+/- 2) After: test string::tests::bench_exact_size_shrink_to_fit ... bench: 26 ns/iter (+/- 1)
2015-01-19Add benchmark for String::shrink_to_fit()Kevin Ballard-0/+16
This uses `Vec::shrink_to_fit()` internally so it's really benchmarking that.
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-3/+3
2015-01-19Implement range and range_mut for BTreePiotr Czarnecki-194/+604
Simplify BTree's iterators, too.
2015-01-19Add test for #21328Adolfo Ochagavía-1/+13
2015-01-19Add a Drain iterator to VecMapAdolfo Ochagavía-6/+55
2015-01-19Make VecMap::into_iter consume the VecMapAdolfo Ochagavía-4/+3
This is a breaking change. To fix it you should pass the VecMap by value instead of by reference. [breaking-change]
2015-01-18Improve the vec![...] macro with UFCS.Eduard Burtescu-8/+8
There are two limitations to the macro that this addresses: 1. the expected type is not propagated, coercions don't trigger 2. references inside element expressions don't outlive the `Vec` Both of these limitations are caused by the block in the macro expansion, previously needed to trigger a coercion from `Box<[T; N]>` to `Box<[T]>`, now possible with UFCS.
2015-01-18auto merge of #21288 : brson/rust/snaps, r=alexcrichtonbors-29/+1
This fixes the issues mentioned in https://github.com/rust-lang/rust/pull/21236, as well as the one https://github.com/rust-lang/rust/issues/21230 where `CFG_BOOTSTRAP_KEY` was being set to simply 'N'. It changes the build such that `RUSTC_BOOTSTRAP_KEY` is only exported on -beta and -stable, so that the behavior of the -dev, -nightly, and snapshot compilers is the same everywhere. Haven't run it completely through 'make check' yet, but the I have verified that the aforementioned issues are fixed. r? @alexcrichton cc @eddyb
2015-01-17Set allow(unstable) in crates that use unstable featuresBrian Anderson-0/+1
Lets them build with the -dev, -nightly, or snapshot compiler
2015-01-17Register new snapshots.Eduard Burtescu-29/+0
2015-01-17add append to vec with testsJeff Belgum-0/+46
2015-01-17s/deriving/derives in Comments/DocsEarl St Sauver-4/+4
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. Fixes #20984
2015-01-17Revert stability for Bitv and BitvSetSimonas Kazlauskas-4/+4
The collections were promoted to stable by mistake and do not match RFC 509. This reverts the stability back to unstable. [breaking-change] since previously stable API became unstable. Fixes #21193
2015-01-17Remove unnecessary explicit conversions to *const Twe-13/+13
2015-01-15rollup merge of #21168: aidanhs/aphs-doc-vec-heapAlex Crichton-1/+1
...to make it slightly clearer that there's not much point in boxing a vec. On a different note, I read the contribution guidelines (https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#pull-request-procedure) which say I should update the copyright date for this file. But I can see that nobody else has done this so far this year, despite there being a fair number of commits. Does that instruction need removing?
2015-01-15rollup merge of #21161: japaric/ufcs-hashAlex Crichton-0/+2
expansion now uses `::std::hash::Hash::hash(&*__self_0_0, __arg_0)` instead of `(*__self_0_0).hash(__arg_0)` closes #21160 r? @alexcrichton
2015-01-15rollup merge of #21126: sleepynate/dlist-examplesAlex Crichton-6/+166
Just some documentation test examples for the DList collection.
2015-01-15rollup merge of #21036: renato-zannon/into-iter-implsAlex Crichton-0/+3
fixes #21027
2015-01-15rollup merge of #20976: jbcrail/rm-unused-importAlex Crichton-1/+0
The BorrowFrom trait was unused by the tests.