summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-12-09doc: these are just renames, so avoid duplicationTshepang Lekhonkhobe-15/+1
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-46/+95
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-02Auto merge of #30146 - steveklabnik:doc_string_intro, r=brsonbors-4/+194
Part of #29376
2015-12-02Write better module-level and type-level docs for StringSteve Klabnik-4/+194
Part of #29376
2015-12-01Auto merge of #30124 - steveklabnik:doc_string_errors, r=alexcrichtonbors-8/+98
Part of #29376
2015-12-01Document the Error types in std::stringSteve Klabnik-8/+98
Part of #29376
2015-12-01Auto merge of #30057 - steveklabnik:doc_str, r=alexcrichtonbors-234/+579
Part of #29338
2015-11-30Rollup merge of #30120 - steveklabnik:doc_string_parse_error, r=alexcrichtonSteve Klabnik-1/+12
Part of #29376
2015-11-30Document std::string::ParseErrorSteve Klabnik-1/+12
Part of #29376
2015-11-30Better docs for the str primitiveSteve Klabnik-234/+579
Part of #29338
2015-11-30Write some docs for ToStringSteve Klabnik-2/+20
Part of #29376
2015-11-26Auto merge of #30015 - petrochenkov:staged, r=brsonbors-1/+1
Closes https://github.com/rust-lang/rust/issues/30008 `#[stable]`, `#[unstable]` and `#[rustc_deprecated]` are now guarded by `#[feature(staged_api)]` r? @brson
2015-11-25Auto merge of #30017 - nrc:fmt, r=brsonbors-982/+1426
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-24rustfmt libcollectionsNick Cameron-982/+1426
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-8/+10
2015-11-18Review fixesVadim Petrochenkov-1/+3
2015-11-18Add missing annotations and some testsVadim Petrochenkov-1/+56
2015-11-16Auto merge of #29830 - petrochenkov:mapdoc, r=alexcrichtonbors-2/+3
r? @steveklabnik
2015-11-14docs: Clarify insertion behavior for mapsVadim Petrochenkov-2/+3
2015-11-13Auto merge of #29811 - bluss:binary-heap-sift-less, r=gankrobors-7/+8
BinaryHeap: Simplify sift down Sift down was doing all too much work: it can stop directly when the current element obeys the heap property in relation to its children. In the old code, sift down didn't compare the element to sift down at all, so it was maximally sifted down and relied on the sift up call to put it in the correct location. This should speed up heapify and .pop(). Also rename Hole::removed() to Hole::element()
2015-11-13BinaryHeap: Simplify sift downUlrik Sverdrup-7/+8
Sift down was doing all too much work: it can stop directly when the current element obeys the heap property in relation to its children. In the old code, sift down didn't compare the element to sift down at all, so it was maximally sifted down and relied on the sift up call to put it in the correct location. This should speed up heapify and .pop(). Also rename Hole::removed() to Hole::element()
2015-11-13Auto merge of #29675 - bluss:merge-sort-fastpath, r=huonwbors-0/+12
sort: Fast path for already sorted data When merging two sorted blocks `left` and `right` if the last element in `left` is <= the first in `right`, the blocks are already in sorted order. Add this as an additional fast path by simply copying the whole left block into the output and advancing the left pointer. The right block is then treated the same way by the already present logic in the merge loop. Can reduce runtime of .sort() to less than 50% of the previous, if the data was already perfectly sorted. Sorted data with a few swaps are also sorted quicker than before. The overhead of one comparison per merge seems to be negligible.
2015-11-12libcollections: deny warnings in doctestsKevin Butler-8/+27
2015-11-08Fix outdated comment in Vec::from_iterStepan Koltsov-2/+1
Since commit 46068c9da, call to `reserve()` on empty vec allocates exactly requested capacity, so unroll of first iteration may help only with branch prediction.
2015-11-07sort: Guard the fast path by length checkUlrik Sverdrup-2/+4
The right part must not be empty.
2015-11-07sort: Fast path for already sorted dataUlrik Sverdrup-0/+10
When merging two sorted blocks `left` and `right` if the last element in `left` is <= the first in `right`, the blocks are already sorted. Add this as an additional fast path by simply copying the whole left block into the output and advancing the left pointer. The right block is then treated the same way by the already present logic in the merge loop. Reduces runtime of .sort() to less than 50% of the previous, if the data was already perfectly sorted. Sorted data with a few swaps are also sorted quicker than before. The overhead of one comparison per merge seems to be negligible.
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