summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-10-01VecDeque: Use power of two capacity even for zero sized typesUlrik Sverdrup-1/+40
VecDeque depends on using a power of two capacity. Use the largest possible power of two capacity for ZSTs.
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-30/+15
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
2015-09-07Add note about clone in docs for vec![]Manish Goregaokar-0/+6
2015-09-03std: Account for CRLF in {str, BufRead}::linesAlex Crichton-4/+6
This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of the `str::lines` and `BufRead::lines` iterators. Both iterators now account for `\r\n` sequences in addition to `\n`, allowing for less surprising behavior across platforms (especially in the `BufRead` case). Splitting *only* on the `\n` character can still be achieved with `split('\n')` in both cases. The `str::lines_any` function is also now deprecated as `str::lines` is a drop-in replacement for it. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md Closes #28032
2015-09-03Use `null()`/`null_mut()` instead of `0 as *const T`/`0 as *mut T`Vadim Petrochenkov-2/+2
2015-09-02Auto merge of #28156 - nagisa:binaryheap-debug, r=Gankrobors-0/+8
r? @Gankro
2015-09-02Auto merge of #28148 - eefriedman:binary_heap, r=alexcrichtonbors-8/+23
2015-09-01Auto merge of #28146 - eefriedman:deque_extras, r=alexcrichtonbors-2/+8
2015-09-01Implement Debug for BinaryHeapSimonas Kazlauskas-0/+8
Fixes #28154
2015-09-01Add missing stability markings to BinaryHeap.Eli Friedman-8/+23
2015-08-31Add missing stability attributes to VecDeque.Eli Friedman-2/+8
2015-08-31hide docs for private `collections::btree::Recover` traitAndrew Paseltiner-0/+1
closes #28093
2015-08-29Auto merge of #28043 - apasel422:rfc-1194, r=alexcrichtonbors-9/+128
2015-08-28re-export debug builders in `std::fmt`Andrew Paseltiner-0/+1
2015-08-28implement RFC 1194Andrew Paseltiner-9/+128
2015-08-28Auto merge of #28038 - durka:grep-unstable-issue-refs, r=alexcrichtonbors-2/+3
After submitting #28031, I ran a [script](https://gist.github.com/durka/a5243440697c780f669b) on the rest of src/ and found some anomalies. In this PR are the fixes that I thought were obvious (but I might be wrong!). The others I've submitted in issue #28037.
2015-08-28Auto merge of #27956 - withoutboats:extend_string, r=alexcrichtonbors-6/+24
If you have an `Iterator<Item=String>` (say because those items were generated using `.to_string()` or similarly), borrow semantics do not permit you map that to an `Iterator<&'a str>`. These two implementations close a small gap in the `String` API. At the same time I've also made the names of the parameters to `String`'s `Extend` and `FromIterator` implementations consistent.
2015-08-27fix some more unstable issue annotationsAlex Burka-2/+3
2015-08-27Implemented Extend<String> and FromIterator<String> for String.Without Boats-6/+24
2015-08-27Auto merge of #27975 - sfackler:iter-order-methods, r=aturonbors-11/+11
This does cause some breakage due to deficiencies in resolve - `path::Components` is both an `Iterator` and implements `Eq`, `Ord`, etc. If one calls e.g. `partial_cmp` on a `Components` and passes a `&Components` intending to target the `PartialOrd` impl, the compiler will select the `partial_cmp` from `Iterator` and then error out. I doubt anyone will run into breakage from `Components` specifically, but we should see if there are third party types that will run into issues. `iter::order::equals` wasn't moved to `Iterator` since it's exactly the same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound, which doensn't seem very useful. I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop the extra `PartialEq` bound. cc #27737 r? @alexcrichton
2015-08-26Make iter::order functions into methods on IteratorSteven Fackler-11/+11
This does cause some breakage due to deficiencies in resolve - `path::Components` is both an `Iterator` and implements `Eq`, `Ord`, etc. If one calls e.g. `partial_cmp` on a `Components` and passes a `&Components` intending to target the `PartialOrd` impl, the compiler will select the `partial_cmp` from `Iterator` and then error out. I doubt anyone will run into breakage from `Components` specifically, but we should see if there are third party types that will run into issues. `iter::order::equals` wasn't moved to `Iterator` since it's exactly the same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound, which doensn't seem very useful. I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop the extra `PartialEq` bound. cc #27737
2015-08-27Auto merge of #27808 - SimonSapin:utf16decoder, r=alexcrichtonbors-120/+5
* Rename `Utf16Items` to `Utf16Decoder`. "Items" is meaningless. * Generalize it to any `u16` iterator, not just `[u16].iter()` * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Replace `Utf16Item::to_char_lossy` with a `Utf16Decoder::lossy` iterator adaptor. This is a [breaking change], but only for users of the unstable `rustc_unicode` crate. I’d like this functionality to be stabilized and re-exported in `std` eventually, as the "low-level equivalent" of `String::from_utf16` and `String::from_utf16_lossy` like #27784 is the low-level equivalent of #27714. CC @aturon, @alexcrichton
2015-08-25Simplify `String`’s `Extend<&str>` implementationChris Morgan-5/+1
Reserving lower_bound bytes was just silly. It’d be perfectly reasonable to have empty strings in the iterator, which could cause superfluous reallocation of the string, or to have more than one byte per string, which could cause additional reallocation (in practice it’ll balance out). The added complexity of this logic is simply pointless, adding a little bloat with no demonstrable advantage and slight disadvantage.
2015-08-23Refactor low-level UTF-16 decoding.Simon Sapin-10/+4
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless. * Move it to `rustc_unicode::char`, exposed in `std::char`. * Generalize it to any `u16` iterable, not just `&[u16]`. * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Add a `REPLACEMENT_CHARACTER` constant. * Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
2015-08-22Move the Borrow and BorrowMut traits to libcore.Simon Sapin-110/+1
2015-08-22Auto merge of #27860 - m4rw3r:rustdoc_unstable_feature_issue, r=alexcrichtonbors-0/+1
Implemented #27759 Example: ![screen shot 2015-08-16 at 21 45 17](https://cloud.githubusercontent.com/assets/108100/9295040/1fb24d50-4460-11e5-8ab8-81ac5330974a.png)
2015-08-18Auto merge of #27891 - steveklabnik:rollup, r=steveklabnikbors-1/+1
- Successful merges: #27881, #27882, #27883, #27884, #27888 - Failed merges:
2015-08-18Auto merge of #27624 - apasel422:issue-27620, r=Gankrobors-2/+23
Closes #27620.
2015-08-18Fixed example in documentationjotomicron-1/+1
Added the cost of the edge 3 -> 4 on the example in the module documentation
2015-08-16rustdoc: Added issue_tracker_base_url annotations to cratesMartin Wernstål-0/+1
2015-08-15collections: Add issues for unstable featuresAlex Crichton-65/+120
2015-08-14Auto merge of #27696 - bluss:into-boxed-str, r=alexcrichtonbors-1/+11
Rename String::into_boxed_slice -> into_boxed_str This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box<str>`. The old name `String::into_boxed_slice` is deprecated.
2015-08-13Rename String::into_boxed_slice -> into_boxed_strUlrik Sverdrup-1/+11
This is the name that was decided in rust-lang/rfcs#1152, and it's better if we say “boxed str” for `Box<str>`. The old name `String::into_boxed_slice` is deprecated.
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-4557/+22
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-11rollup merge of #27678: alexcrichton/snapshotsAlex Crichton-38/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-11rollup merge of #27622: eefriedman/https-urlAlex Crichton-3/+3
Also fixes a few outdated links.
2015-08-11Register new snapshotsAlex Crichton-38/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-10Remove transmute from `btree::node::Node::as_slices_internal_mut`Andrew Paseltiner-2/+23
Closes #27620.
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-3/+3
Also fixes a few outdated links.
2015-08-09Change TODO to FIXMETobias Bucher-1/+1
2015-08-09Make `str::as_bytes_mut` privateTobias Bucher-13/+0
2015-08-09Make `slice::transmute*` privateTobias Bucher-1/+0
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-13/+26
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-06Auto merge of #27545 - apasel422:btree-range, r=Gankrobors-6/+22
This permits collections with `String` keys to be ranged over with `&str` bounds. The `K` defaults for `Min` and `Max` permit the default type parameter fallback to work with things like ```rust use std::collections::{BTreeSet, Bound}; let set = BTreeSet::<String>::new(); set.range(Bound::Included("a"), Bound::Unbounded); ``` Without the defaults, the type of the maximum bound would be unconstrained. r? @Gankro
2015-08-05Fully generalize `BTree{Map, Set}` range iteratorsAndrew Paseltiner-6/+22
This permits collections with `String` keys to be ranged over with `&str` bounds. The `K` defaults for `Min` and `Max` permit the default type parameter fallback to work with things like ```rust use std::collections::{BTreeSet, Bound}; let set = BTreeSet::<String>::new(); set.range(Bound::Included("a"), Bound::Unbounded); ``` Without the defaults, the type of the maximum bound would be unconstrained.
2015-08-05Make note of Hash in Borrow's docsSteve Klabnik-0/+3
This should be a bit more prominent. Fixes #27109
2015-08-03syntax: Implement #![no_core]Alex Crichton-16/+28
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-30Auto merge of #26734 - Gankro:deprecate-vecmap, r=alexcrichtonbors-2/+7
VecMap doesn't really fit with the current standard library's strategy (small!). I've mirrored the code to https://github.com/contain-rs/vec-map but @GBGamer has already claimed the name on crates.io a couple months ago for the same purpose. It hasn't been updated since, though. CC @rust-lang/libs
2015-07-29deprecate vecmapAlexis Beingessner-2/+7
2015-07-30Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnikManish Goregaokar-9/+11
r? @steveklabnik