about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2016-05-30Rollup merge of #33893 - Ophirr33:docs_string_split_fix, r=GuillaumeGomezManish Goregaokar-2/+28
Added examples/docs to split in str.rs Added documentation clarifying the behavior of split when used with the empty string and contiguous separators. Addresses issue [33882](https://github.com/rust-lang/rust/issues/33882). This is my first time contributing to rust, so forgive me if I'm skipping any of the contribution steps. Fixes #33882
2016-05-27Added examples/docs to split in str.rsTy Coghlan-2/+28
Added documentation clarifying the behavior of split when used with the empty string and contiguous separators.
2016-05-27Rollup merge of #33858 - liigo:patch-7, r=GuillaumeGomezGuillaume Gomez-1/+1
Point out the clone operation in summary line docs of `Vec::extend_from_slice`
2016-05-25Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturonbors-13/+10
std: Stabilize APIs for the 1.10 release This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-25Point out the clone operation in summary line docs of `Vec::extend_from_slice`Liigo Zhuang-1/+1
2016-05-24std: Stabilize APIs for the 1.10 releaseAlex Crichton-13/+10
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-20Clarify docs for sort(&mut self)Stefan Schindler-7/+4
2016-05-16Rollup merge of #33635 - tshepang:capitalise, r=steveklabnikEduard-Mihai Burtescu-1/+1
doc: 'tis the lang, not the reptile
2016-05-16Rollup merge of #33634 - tshepang:nicer-output, r=steveklabnikEduard-Mihai Burtescu-1/+1
doc: improve output
2016-05-16Rollup merge of #33633 - tshepang:no-effect, r=steveklabnikEduard-Mihai Burtescu-2/+0
doc: this statement does not have an effect
2016-05-16Rollup merge of #33605 - tshepang:less-awkward, r=steveklabnikEduard-Mihai Burtescu-2/+2
doc: use less awkward and less confusing language
2016-05-16Rollup merge of #33604 - tshepang:line-em-up, r=GuillaumeGomezEduard-Mihai Burtescu-1/+1
doc: line these comments up Looks more nice, and same is done with prior examples
2016-05-16Rollup merge of #33603 - tshepang:no-need, r=apasel422Eduard-Mihai Burtescu-2/+2
doc: to_string not needed since we gots coercion
2016-05-15Rollup merge of #33598 - haikoschol:master, r=alexcrichtonManish Goregaokar-1/+1
doc: Fix comment in std::string::String example code
2016-05-14doc: 'tis the lang, not the reptileTshepang Lekhonkhobe-1/+1
2016-05-14doc: improve outputTshepang Lekhonkhobe-1/+1
2016-05-14doc: this statement does not have an effectTshepang Lekhonkhobe-2/+0
2016-05-12doc: to_string not needed since we gots coercionTshepang Lekhonkhobe-2/+2
2016-05-12doc: use less awkward and less confusing languageTshepang Lekhonkhobe-2/+2
2016-05-12Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brsonbors-1/+4
rustbuild: Add support for crate tests + doctests This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12doc: line these comments upTshepang Lekhonkhobe-1/+1
Looks more nice, and same is done with prior examples
2016-05-12doc: Fix comment in std::string::String example codeHaiko Schol-1/+1
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-1/+4
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-11Rollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnikSteve Klabnik-0/+12
Doc improvement on std::fmt module Part of #29355. r? @steveklabnik
2016-05-10Doc improvement on std::fmt moduleGuillaume Gomez-0/+12
2016-05-07Rollup merge of #33402 - shepmaster:copied-variable-name, r=ManishearthSteve Klabnik-2/+2
Replace copy-pasted variable name with relevant one
2016-05-04Replace copy-pasted variable name with relevant oneJake Goulding-2/+2
2016-05-03Rollup merge of #33277 - birkenfeld:fmt-named-dollar-args, r=steveklabnikManish Goregaokar-4/+9
Fix std::fmt format spec: named args are allowed with "$" syntax
2016-04-30Auto merge of #33276 - bwinterton:btreeset-insert-doc-fix, r=GuillaumeGomezbors-2/+2
Make BTreeSet::Insert docs more consistent Made the BTreeSet::Insert documentation consistent with the HashSet::Insert documentation by using the term 'value' instead of 'key'. r? @steveklabnik
2016-04-29Auto merge of #33148 - sfackler:entry-key, r=alexcrichtonbors-0/+9
Add Entry::key This method was present on both variants of Entry, but not the enum cc #32281 r? @alexcrichton
2016-04-29Fix std::fmt format spec: named args are allowed with "$" syntaxGeorg Brandl-4/+9
2016-04-29Make Btreeset::Insert docs more consistentBrayden Winterton-2/+2
2016-04-28Clarify std::fmt width docs w.r.t. dollar syntax and give example.Georg Brandl-2/+13
2016-04-22Implement `append` for b-trees.Johannes Oertel-24/+339
The algorithm implemented here is linear in the size of the two b-trees. It firsts creates a `MergeIter` from the two b-trees and then builds a new b-tree by pushing key-value pairs from the `MergeIter` into nodes at the right heights. Three functions for stealing have been added to the implementation of `Handle` as well as a getter for the height of a `NodeRef`. The docs have been updated with performance information about `BTreeMap::append` and the remark about B has been removed now that it is the same for all instances of `BTreeMap`.
2016-04-21Add Entry::keySteven Fackler-0/+9
This method was present on both variants of Entry, but not the enum cc #32281
2016-04-20Auto merge of #32951 - LukasKalbertodt:collection_contains_rfc1552, r=brsonbors-0/+21
Add `contains` to `VecDeque` and `LinkedList` (+ tests) This implements [RFC 1552](https://github.com/rust-lang/rfcs/blob/master/text/1552-contains-method-for-various-collections.md). Tracking issue: #32630 Sorry for the late response. This is my first contribution, so please tell me if anything isn't optimal!
2016-04-18Auto merge of #32866 - davidhewitt:master, r=apasel422bors-0/+179
Implement `From<Vec<T>>` and `Into<Vec<T>>` for `VecDeque<T>`
2016-04-18Added From<VecDeque<T>> for Vec<T> and From<Vec<T>> for VecDeque<T>David Hewitt-0/+179
2016-04-17Auto merge of #33050 - apasel422:bh, r=alexcrichtonbors-0/+1
Implement `Clone` for `binary_heap::IntoIter` r? @alexcrichton
2016-04-17Implement `Clone` for `binary_heap::IntoIter`Andrew Paseltiner-0/+1
2016-04-17Rollup merge of #31441 - gereeter:btree-docs, r=blussManish Goregaokar-5/+176
Start documenting BTreeMap's node interface cc @Gankro @apasel422
2016-04-17Auto merge of #32987 - xosmig:binary_heap_extension, r=apasel422bors-5/+88
collections: add append for binary heap
2016-04-16Auto merge of #32977 - alexcrichton:ignore-panics, r=brsonbors-4/+8
std: Change String::truncate to panic less The `Vec::truncate` method does not panic if the length argument is greater than the vector's current length, but `String::truncate` will indeed panic. This semantic difference can be a bit jarring (e.g. #32717), and after some discussion the libs team concluded that although this can technically be a breaking change it is almost undoubtedly not so in practice. This commit changes the semantics of `String::truncate` to be a noop if `new_len` is greater than the length of the current string. Closes #32717
2016-04-15slice: Add tracking issue for slice_binary_search_by_keyKamal Marhubi-1/+1
2016-04-16collections: add append and extend specialization for binary heapAndrey Tonkih-5/+88
2016-04-15std: Change String::truncate to panic lessAlex Crichton-4/+8
The `Vec::truncate` method does not panic if the length argument is greater than the vector's current length, but `String::truncate` will indeed panic. This semantic difference can be a bit jarring (e.g. #32717), and after some discussion the libs team concluded that although this can technically be a breaking change it is almost undoubtedly not so in practice. This commit changes the semantics of `String::truncate` to be a noop if `new_len` is greater than the length of the current string. Closes #32717
2016-04-15Auto merge of #32851 - apasel422:spec-extend, r=alexcrichtonbors-0/+34
Specialize `Extend` to `append` for `{LinkedList, Vec}`
2016-04-14Auto merge of #32693 - kamalmarhubi:binary_search_by_key, r=alexcrichtonbors-0/+39
collections: Add slice::binary_search_by_key This method adds to the family of `_by_key` methods, and is the counterpart of `slice::sort_by_key`. It was mentioned on #30423 but was not implemented at that time. Refs #30423
2016-04-14Add `contains` to `VecDeque` and `LinkedList` (+ tests)Lukas Kalbertodt-0/+21
2016-04-14Specialize `Extend` to `append` for `{LinkedList, Vec}`Andrew Paseltiner-0/+34