about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-02-22Improve documentation for libcollections/strSteve Klabnik-274/+440
2015-02-22Desugar the implementation of extend to work with IteratorMikhail Zabaluev-2/+7
Implement both Vec::from_iter and extend in terms of an internal method working with Iterator. Otherwise, the code below ends up using two monomorphizations of extend, differing only in the implementation of IntoIterator: let mut v = Vector::from_iter(iterable1); v.extend(iterable2);
2015-02-22In Vec::from_iter, unroll the first iterationMikhail Zabaluev-1/+19
For the first ever element to put into a vector, the branching conditions are more predictable.
2015-02-22Optimize Vec::from_iter and extendMikhail Zabaluev-42/+26
Use one loop, efficient for both sized and size-ignorant iterators (including iterators lying about their size).
2015-02-22Eliminate more excessive null-checks from slice iteratorsBjörn Steinbrink-1/+4
This adds the assume() calls back that got lost when rebasing #21886.
2015-02-22Implement append and split_off for VecMap (RFC 509)Markus Siemens-2/+170
Implements `append()` and `split_off()` for `VecMap`. It's worth noting that `append()` will overwrite existing keys (the RFC doesn't specify how `append()` should handle duplicate keys). cc #19986
2015-02-21Remove last traces of BitV and BitVSet from documentationFlorian Hartwig-1/+1
2015-02-21Kill fmt::Show and fmt::String with fire!Simonas Kazlauskas-1/+1
Toss the tomatoes!
2015-02-20Register new snapshotsAlex Crichton-422/+4
2015-02-20Tweaks to equality comparisons for slices/arrays/vectorsVadim Petrochenkov-59/+24
2015-02-20Addressed PR commentsMarvin Löbel-11/+17
2015-02-20Fix tidy and rebase falloutMarvin Löbel-33/+0
Added a few bugfixes and additional testcases
2015-02-20Enabled new pattern API in the libstd facadeMarvin Löbel-16/+22
2015-02-20Refactored code into Searcher traits with naive implementationsMarvin Löbel-2/+2
Made the family of Split iterators use the Pattern API Renamed the Matcher traits into Searcher
2015-02-18Round 4 test fixes and rebase conflictsAlex Crichton-4/+4
2015-02-18rollup merge of #22286: nikomatsakis/variance-4bAlex Crichton-94/+131
Conflicts: src/librustc/middle/infer/combine.rs src/librustc_typeck/check/wf.rs
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-63/+63
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18rollup merge of #22210: aturon/stab-final-borrowAlex Crichton-67/+709
Conflicts: src/libcollections/btree/map.rs src/libcollections/str.rs src/libcollections/vec.rs src/libcore/borrow.rs src/libcore/hash/mod.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs
2015-02-18Round 1 fixes and rebase conflictsAlex Crichton-2/+2
2015-02-18Stabilize std::borrowAaron Turon-66/+698
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-63/+63
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-4/+4
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-868/+916
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18rollup merge of #22480: alexcrichton/hashv3Alex Crichton-4/+94
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18rollup merge of #22287: Ryman/purge_carthographersAlex Crichton-5/+5
This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary. This also implements `RandomAccessIterator` for `iter::Cloned` cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment
2015-02-18make FromIterator use IntoIteratorAlexis-23/+25
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-17/+22
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18Implement RFC 580Aaron Turon-835/+876
This commit implements RFC 580 by renaming: * DList -> LinkedList * Bitv -> BitVec * BitvSet -> BitSet * RingBuf -> VecDeque More details are in [the RFC](https://github.com/rust-lang/rfcs/pull/580) [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-4/+94
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Fallout: RingBuf, use Unique.Niko Matsakis-29/+31
2015-02-18Fallout: EnumSet, add Marker.Niko Matsakis-9/+15
2015-02-18Fallout: port btree to use Unique, some markers.Niko Matsakis-32/+52
2015-02-18Fallout: btree. Rephrase invariant lifetime in terms of PhantomData.Niko Matsakis-4/+13
2015-02-18Fallout: Port Vec to use `Unique`Niko Matsakis-20/+20
2015-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-4/+4
2015-02-18Eliminate excessive null-checks from slice iteratorsBjörn Steinbrink-1/+6
The data pointer used in the slice is never null, using assume() to tell LLVM about it gets rid of various unneeded null checks when iterating over the slice. Since the snapshot compiler is still using an older LLVM version, omit the call in stage0, because compile times explode otherwise. Benchmarks from #18193 ```` running 5 tests test _range ... bench: 33329 ns/iter (+/- 417) test assembly ... bench: 33299 ns/iter (+/- 58) test enumerate ... bench: 33318 ns/iter (+/- 83) test iter ... bench: 33311 ns/iter (+/- 130) test position ... bench: 33300 ns/iter (+/- 47) test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured ```` Fixes #18193
2015-02-17Register new snapshotsAlex Crichton-251/+0
2015-02-17Test fixes and rebase conflictsAlex Crichton-5/+8
2015-02-17rollup merge of #22394: alexcrichton/vec-from-iter-commentAlex Crichton-10/+19
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17rollup merge of #22435: aturon/final-stab-threadAlex Crichton-2/+2
Conflicts: src/test/bench/rt-messaging-ping-pong.rs src/test/bench/rt-parfib.rs src/test/bench/task-perf-spawnalot.rs
2015-02-17rollup merge of #22457: steveklabnik/gh22361Alex Crichton-3/+5
FIxes #22361
2015-02-17rollup merge of #22455: msiemens/add-vec-from_elemAlex Crichton-3/+49
Implement `Vec::from_elem` by making the `vec![element; len]` macro more powerful (see rust-lang/rfcs#832). Closes #22414 r? @Gankro
2015-02-17rollup merge of #22454: alexcrichton/stabilize-into-iteratorAlex Crichton-0/+21
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-5/+5
2015-02-17std: Add Vec::from_iter commentAlex Crichton-10/+19
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17Fallout from stabilizationAaron Turon-2/+2
2015-02-17Implement `Vec::from_elem` (RFC 832)Markus Siemens-3/+49
Implement `Vec::from_elem` by making the `vec![element; len]` macro more powerful (see RFC 832). Closes #22414
2015-02-17Clarify RingBuf documentation.Steve Klabnik-3/+5
FIxes #22361
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+21
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonbors-4/+4
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon