summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2016-05-26std: 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
2016-04-14fix str::split_at_mut() exampleGigih Aji Ibrahim-2/+2
2016-04-12collections: Add slice::binary_search_by_keyKamal Marhubi-0/+39
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-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-25/+36
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-05Add example doc for ToOwned traitGuillaume Gomez-0/+12
2016-04-01Implement `values_mut` on `BTreeMap`.Corey Farwell-0/+60
https://github.com/rust-lang/rust/issues/32551