about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-03-23rollup merge of #23269: shepmaster/split-not-double-endedAlex Crichton-9/+36
Closes #23262
2015-03-23Remove auto-deref'ing Pattern impl because it conflicts with otherNiko Matsakis-0/+20
possible blanket impls and also triggers internal overflow. Add some special cases for common uses (&&str, &String) for now; bounds-targeting deref coercions are probably the right longer term answer.
2015-03-23Add generic conversion traitsAaron Turon-30/+96
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+163
2015-03-23Require feature attributes, and add them where necessaryBrian Anderson-1/+1
2015-03-23Rollup merge of #23509 - aturon:stab-entry, r=GankroSteve Klabnik-15/+17
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions. r? @Gankro
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-2/+63
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-1/+184
references. For collections whose keys are integers, we take both references and by-value.
2015-03-23Compiler and trait changes to make indexing by value.Niko Matsakis-0/+12
2015-03-23document iteration order for `vec_deque::IntoIter`Andrew Paseltiner-1/+1
2015-03-23implement `ExactSizeIterator` for `linked_list::IntoIter`Andrew Paseltiner-0/+2
2015-03-23implement `Clone` for various iteratorsAndrew Paseltiner-0/+5
2015-03-23Rollup merge of #23559 - aturon:future-proof-map-index, r=GankroManish Goregaokar-10/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448 r? @Gankro
2015-03-22Note order of BinaryHeap::drainSteve Klabnik-0/+2
Fixes #23564
2015-03-21implement `Clone` for `btree` iteratorsAndrew Paseltiner-0/+41
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-3/+4
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-20Future-proof indexing on maps: remove IndexMutAaron Turon-10/+1
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448
2015-03-19StrExt::splitn should not require a DoubleEndedSearcherJake Goulding-10/+9
Closes #23262
2015-03-19Introduce rsplitJake Goulding-2/+30
2015-03-18Stabilize Entry typesAaron Turon-15/+17
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions.
2015-03-19Document {:.*}Steve Klabnik-5/+12
Fixes #22927
2015-03-19Small formatting fixes to fmt.rsSteve Klabnik-22/+23
2015-03-18Register new snapshotsAlex Crichton-2223/+16
2015-03-18Rollup merge of #23455 - Ryman:trim_matches_doc, r=steveklabnikManish Goregaokar-2/+2
2015-03-17std: Tweak some unstable features of `str`Alex Crichton-60/+108
This commit clarifies some of the unstable features in the `str` module by moving them out of the blanket `core` and `collections` features. The following methods were moved to the `str_char` feature which generally encompasses decoding specific characters from a `str` and dealing with the result. It is unclear if any of these methods need to be stabilized for 1.0 and the most conservative route for now is to continue providing them but to leave them as unstable under a more specific name. * `is_char_boundary` * `char_at` * `char_range_at` * `char_at_reverse` * `char_range_at_reverse` * `slice_shift_char` The following methods were moved into the generic `unicode` feature as they are specifically enabled by the `unicode` crate itself. * `nfd_chars` * `nfkd_chars` * `nfc_chars` * `graphemes` * `grapheme_indices` * `width`
2015-03-17Fix documentation for StrExt::trim_matchesKevin Butler-2/+2
2015-03-17Rollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiynManish Goregaokar-34/+34
As suggested by @steveklabnik in #23254, I removed the redundant Rust syntax highlighting from the documentation.
2015-03-16better document the hacks required to test libcollectionsJorge Aparicio-103/+133
2015-03-16fix after rebaseJorge Aparicio-0/+1
2015-03-16move some tests back to libcollectionsJorge Aparicio-0/+564
2015-03-16extract libcollections tests into libcollectionstestJorge Aparicio-9217/+0
2015-03-16impl {i,u}{8,16,32,64,size}Jorge Aparicio-2/+7
2015-03-16impl<T> *const T, impl<T> *mut TJorge Aparicio-0/+1
2015-03-16impl<T> [T]Jorge Aparicio-0/+892
2015-03-16impl strJorge Aparicio-0/+1140
2015-03-16impl charJorge Aparicio-1/+0
2015-03-16Auto merge of #23342 - apasel422:23327, r=alexcrichtonbors-0/+18
closes #23327
2015-03-16Auto merge of #23347 - aturon:stab-misc, r=alexcrichtonbors-3/+4
This commit deprecates the `count`, `range` and `range_step` functions in `iter`, in favor of range notation. To recover all existing functionality, a new `step_by` adapter is provided directly on `ops::Range` and `ops::RangeFrom`. [breaking-change] r? @alexcrichton
2015-03-16document undefined collection behavior with interior mutabilityAndrew Paseltiner-0/+18
closes #23327
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-34/+34
2015-03-13Deprecate range, range_step, count, distributionsAaron Turon-3/+4
This commit deprecates the `count`, `range` and `range_step` functions in `iter`, in favor of range notation. To recover all existing functionality, a new `step_by` adapter is provided directly on `ops::Range` and `ops::RangeFrom`. [breaking-change]
2015-03-13slice::from_raw_parts is preferred over transmuting a fresh raw::SliceOliver Schneider-26/+13
2015-03-12Rollup merge of #23270 - frewsxcv:patch-5, r=alexcrichtonManish Goregaokar-0/+1
Markdown requires a newline before bullet points, and since there's not one here, they'll get rendered incorrectly
2015-03-12Rollup merge of #23297 - steveklabnik:examples, r=huonwManish Goregaokar-17/+17
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11Example -> ExamplesSteve Klabnik-17/+17
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-11Auto merge of #23256 - apasel422:bound, r=alexcrichtonbors-0/+1
2015-03-10Fix markdown bullet points in function docsCorey Farwell-0/+1
Markdown requires a newline before bullet points, and since there's not one here, they'll get rendered incorrectly
2015-03-10Auto merge of #23126 - alexcrichton:char-third-pass, r=aturonbors-24/+55
This commit performs another pass over the `std::char` module for stabilization. Some minor cleanup is performed such as migrating documentation from libcore to libunicode (where the `std`-facing trait resides) as well as a slight reorganiation in libunicode itself. Otherwise, the stability modifications made are: * `char::from_digit` is now stable * `CharExt::is_digit` is now stable * `CharExt::to_digit` is now stable * `CharExt::to_{lower,upper}case` are now stable after being modified to return an iterator over characters. While the implementation today has not changed this should allow us to implement the full set of case conversions in unicode where some characters can map to multiple when doing an upper or lower case mapping. * `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not having to worry about characters expanding to more characters when you just want the whole string to get into upper or lower case. This is a breaking change due to the change in the signatures of the `CharExt::to_{upper,lower}case` methods. Code can be updated to use functions like `flat_map` or `collect` to handle the difference. [breaking-change] Closes #20333
2015-03-10std: Stabilize more of the `char` moduleAlex Crichton-24/+55
This commit performs another pass over the `std::char` module for stabilization. Some minor cleanup is performed such as migrating documentation from libcore to libunicode (where the `std`-facing trait resides) as well as a slight reorganiation in libunicode itself. Otherwise, the stability modifications made are: * `char::from_digit` is now stable * `CharExt::is_digit` is now stable * `CharExt::to_digit` is now stable * `CharExt::to_{lower,upper}case` are now stable after being modified to return an iterator over characters. While the implementation today has not changed this should allow us to implement the full set of case conversions in unicode where some characters can map to multiple when doing an upper or lower case mapping. * `StrExt::to_{lower,upper}case` was added as unstable for a convenience of not having to worry about characters expanding to more characters when you just want the whole string to get into upper or lower case. This is a breaking change due to the change in the signatures of the `CharExt::to_{upper,lower}case` methods. Code can be updated to use functions like `flat_map` or `collect` to handle the difference. [breaking-change]
2015-03-10derive common traits for `collections::Bound`Andrew Paseltiner-0/+1