summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
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
2015-02-17Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonManish Goregaokar-4/+4
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22394 - alexcrichton:vec-from-iter-comment, r=brsonManish Goregaokar-0/+11
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17std: Add Vec::from_iter commentAlex Crichton-0/+11
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+264
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-17Rollup merge of #22253 - huonw:unstable-words, r=aturonManish Goregaokar-1/+2
It is not totally clear if we should just use whitespace, or if the full unicode word-breaking algorithm is more correct. If there is demand we can reconsider this decision (and consider the precise algorithm to use in detail). cc #15628.
2015-02-16Auto merge of #22367 - Manishearth:rollup, r=steveklabnikbors-3/+20
(still testing locally)
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-2/+0
2015-02-15Rollup merge of #22247 - Gankro:dlist_split, r=alexcrichtonManish Goregaokar-1/+20
2015-02-15Auto merge of #22242 - Gankro:collect-ints, r=alexcrichtonbors-58/+58
2015-02-15Auto merge of #22058 - Gankro:all-the-impls, r=huonwbors-0/+151
Working on just knocking these out for all the collections so that there's something there.
2015-02-14naive RingBuf::append implAlexis-1/+50
2015-02-13allow DList to split_at . fixes #22244Alexis-1/+20
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+264
2015-02-14Rename `fmt::Writer` to `fmt::Write`Chris Wong-4/+4
This brings it in line with its namesake in `std::io`. [breaking-change]