about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-11-06Auto merge of #29643 - petrochenkov:stability5, r=alexcrichtonbors-7/+0
Also remove `stable` stability annotations from inherent impls (There will be a warning for useless stability annotations soon.) r? @Gankro
2015-11-05Rollup merge of #29614 - bluss:vec-drop-comment, r=GankroSteve Klabnik-4/+0
vec: Remove old comment in Vec::drop This comment was leftover from an earlier revision of a PR, something that never was merged. There is no ZST special casing in Vec::drop.
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-7/+0
Remove `stable` stability annotations from inherent impls
2015-11-05vec: Remove old comment in Vec::dropUlrik Sverdrup-4/+0
This comment was leftover from an earlier revision of a PR, something that never was merged. There is no ZST special casing in Vec::drop.
2015-11-04Mention [T]::sort is stable in docsSteve Klabnik-0/+2
Fixes #27322
2015-11-03Auto merge of #29545 - mystor:vec-deque-test-panic, r=blussbors-7/+9
I think this should fix the test failures in debug mode from #29492 The assertion was written incorrectly, and I don't like the way the new assertion is written, but I _think_ it does the right thing now.
2015-11-03Correct incorrect assertion in VecDeque::wrap_copyMichael Layzell-7/+9
2015-11-03libcollections: DRY up a PartialEq impl for StringKevin Butler-18/+3
2015-10-30don't use drop_in_place as an intrinsicAlexis Beingessner-2/+3
2015-10-30Auto merge of #29458 - tshepang:better, r=alexcrichtonbors-2/+3
I see that `extend()` is not called if new_len > len()
2015-10-29doc: fix and expand explanationTshepang Lekhonkhobe-2/+3
I see that `extend()` is not called if new_len > len()
2015-10-28Update docstring for truncateCameron Sun-2/+2
This documentation confused me when trying to use truncate on a project. Originally, it was unclear whether truncate removed the last `len` elements, or whether it cut down the vector to be exactly `len` elements long. The example was also ambiguous.
2015-10-25Auto merge of #29254 - alexcrichton:stabilize-1.5, r=brsonbors-90/+77
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-90/+77
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-23Unsafety -> Safety in doc headingsSteve Klabnik-4/+4
Follow https://doc.rust-lang.org/book/documentation.html#special-sections
2015-10-23Auto merge of #27894 - steveklabnik:gh26888, r=alexcrichtonbors-4/+16
{BTree,Hash}{Map,Set} will not update their key if it already exists, which can matter with more complex keys. This behavior is now documented. Fixes #26888
2015-10-22Document replacement behavior in some collectionsSteve Klabnik-4/+16
{BTree,Hash}{Map,Set} will not update their key if it already exists, which can matter with more complex keys. This behavior is now documented. Fixes #26888
2015-10-21Auto merge of #29186 - pnkfelix:fsk-fix-issue-29166, r=alexcrichtonbors-0/+1
Add dropck unsafe escape hatch (UGEH) to vec::IntoIter. Fix #29166
2015-10-20Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.Felix S. Klock II-0/+1
Fix #29166
2015-10-20Auto merge of #27723 - mystor:vecdeque_drain_range, r=blussbors-14/+274
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's. Tests haven't been written for the new function yet.
2015-10-19Correct spelling in docsAndrew Paseltiner-1/+1
2015-10-13Correct spelling in docsAndrew Paseltiner-2/+2
2015-10-10Trivial typo fix: from_utrf8 should be from_utf8Andrew Chin-1/+1
2015-10-10Auto merge of #28861 - pnkfelix:fsk-nonparam-dropck-issue28498, r=arielb1bors-0/+12
implement RFC 1238: nonparametric dropck. cc #28498 cc @nikomatsakis
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-10-08Add unsafe Send and Sync impls to VecDeque's Drain<T>Michael Layzell-0/+3
2015-10-07doc: Mention split_whitespace in split docBoris Egorov-0/+4
2015-10-06Add RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.Felix S. Klock II-0/+12
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to bootstrap; but of course that alone was not sufficient for `make check`. Later I added `unsafe_destructor_blind_to_params` to collections, in particular `LinkedList` and `RawTable` (the backing representation for `HashMap` and `HashSet`), to get the regression tests exercising cyclic structure from PR #27185 building. ---- Note that the feature is `dropck_parametricity` (which is not the same as the attribute's name). We will almost certainly vary our strategy here in the future, so it makes some sense to have a not-as-ugly name for the feature gate. (The attribute name was deliberately selected to be ugly looking.)
2015-10-02Improve documentation for the from_utf8 familySteve Klabnik-18/+111
Our docs were very basic for the various versions of from_utf8, so this commit beefs them up. It also improves docs for the &str variant's error, Utf8Error.
2015-10-01fixup wordingAlexis Beingessner-1/+1
2015-10-01flesh out what Vec actually guaranteesAlexis Beingessner-0/+75
2015-09-30Format panic docs for split_atSteve Klabnik-0/+2
Fixes #28384
2015-09-30Auto merge of #28731 - bluss:by-ref, r=alexcrichtonbors-2/+2
Remove redundant uses of Iterator::by_ref()
2015-09-29Remove redundant uses of Iterator::by_ref()Ulrik Sverdrup-2/+2
2015-09-28Use code formatting for code-relevant values in std::fmt docsCarol (Nichols || Goulding)-13/+13
Especially when documenting the use of `0`, since zero looks very similar to `O` in fonts not meant for displaying code. Other literal characters, traits, etc should also use code formatting. This change makes this documentation more internally consistent.
2015-09-27Auto merge of #28689 - Manishearth:rollup, r=Manishearthbors-26/+2
- Successful merges: #28664, #28673, #28681, #28682, #28688 - Failed merges:
2015-09-27Rollup merge of #28682 - apasel422:features, r=steveklabnikManish Goregaokar-8/+0
2015-09-27Rollup merge of #28664 - apasel422:collections-debug, r=alexcrichtonManish Goregaokar-18/+2
2015-09-27Auto merge of #28663 - bluss:vec-as-mut, r=alexcrichtonbors-0/+14
Implement AsMut for Vec Fixes #28549
2015-09-26Auto merge of #28635 - alexcrichton:str-parse-error-void, r=aturonbors-2/+22
It can never be instantiated, so signify this by having it actually be an empty `enum`. cc #27734
2015-09-26Auto merge of #28632 - alexcrichton:update-match-indices, r=Kimundibors-42/+30
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow the same pattern as the `chars` and `char_indices` iterators. The `matches` iterator currently yield `&str` elements, so the `MatchIndices` iterator now yields the index of the match as well as the `&str` that matched (instead of start/end indexes). cc #27743
2015-09-26Remove unnecessary `#![feature]` attributesAndrew Paseltiner-8/+0
2015-09-25Add AsMut<Vec<T>> for Vec<T>Ulrik Sverdrup-0/+7
2015-09-25std: Update MatchIndices to return a subsliceAlex Crichton-42/+30
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow the same pattern as the `chars` and `char_indices` iterators. The `matches` iterator currently yield `&str` elements, so the `MatchIndices` iterator now yields the index of the match as well as the `&str` that matched (instead of start/end indexes). cc #27743
2015-09-25Simplify `Debug` for `{EnumSet, VecDeque}`Andrew Paseltiner-18/+2
2015-09-25Implement AsMut for VecUlrik Sverdrup-0/+7
Fixes #28549
2015-09-24std: Switch string::ParseError to an empty enumAlex Crichton-2/+22
It can never be instantiated, so signify this by having it actually be an empty `enum`. cc #27734
2015-09-24Auto merge of #28602 - apasel422:clone_from, r=blussbors-11/+28
r? @bluss
2015-09-24Optimize `Vec::clone_from`Andrew Paseltiner-9/+5
Before: test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 1) test dst_bigger::src_100_dst_1000::clone_from ... bench: 75 ns/iter (+/- 3) test dst_bigger::src_10_dst_100::clone ... bench: 25 ns/iter (+/- 0) test dst_bigger::src_10_dst_100::clone_from ... bench: 9 ns/iter (+/- 1) test eq::src_1000_dst_1000::clone ... bench: 105 ns/iter (+/- 2) test eq::src_1000_dst_1000::clone_from ... bench: 593 ns/iter (+/- 21) test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 1) test eq::src_100_dst_100::clone_from ... bench: 75 ns/iter (+/- 1) test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 5) test src_bigger::src_1000_dst_100::clone_from ... bench: 148 ns/iter (+/- 5) test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 1) test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0) After: test dst_bigger::src_100_dst_1000::clone ... bench: 34 ns/iter (+/- 2) test dst_bigger::src_100_dst_1000::clone_from ... bench: 15 ns/iter (+/- 1) test dst_bigger::src_10_dst_100::clone ... bench: 26 ns/iter (+/- 1) test dst_bigger::src_10_dst_100::clone_from ... bench: 7 ns/iter (+/- 0) test eq::src_1000_dst_1000::clone ... bench: 103 ns/iter (+/- 1) test eq::src_1000_dst_1000::clone_from ... bench: 85 ns/iter (+/- 4) test eq::src_100_dst_100::clone ... bench: 34 ns/iter (+/- 2) test eq::src_100_dst_100::clone_from ... bench: 15 ns/iter (+/- 1) test src_bigger::src_1000_dst_100::clone ... bench: 103 ns/iter (+/- 4) test src_bigger::src_1000_dst_100::clone_from ... bench: 90 ns/iter (+/- 2) test src_bigger::src_100_dst_10::clone ... bench: 34 ns/iter (+/- 2) test src_bigger::src_100_dst_10::clone_from ... bench: 20 ns/iter (+/- 0) Closes #28601.
2015-09-23Fix bad copypasta for patterns doc in std::strRemi Rampin-12/+9