about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-05-07Rollup merge of #33439 - birkenfeld:ip-rfc-refs, r=steveklabnikSteve Klabnik-5/+5
doc: make RFC references consistent Always add a space and end sentence with a full stop.
2016-05-07Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnikSteve Klabnik-2/+2
Fix some some duplicate words.
2016-05-07Rollup merge of #33326 - birkenfeld:issue-33321, r=GuillaumeGomezSteve Klabnik-15/+14
std::thread docs: spawn() does not return a Thread anymore Also move the "Thread type" section down a bit, since it is not so important anymore. Fixes: #33321
2016-05-07Rollup merge of #33283 - GuillaumeGomez:process_doc, r=steveklabnikSteve Klabnik-4/+196
Add process types documentation Part of #29370. r? @steveklabnik
2016-05-06Auto merge of #33086 - cardoe:non-blocking-rand-read, r=alexcrichtonbors-3/+20
rand: don't block before random pool is initialized If we attempt a read with getrandom() on Linux the syscall can block before the random pool is initialized unless the GRND_NONBLOCK flag is passed. This flag causes getrandom() to instead return EAGAIN while the pool is uninitialized. To avoid downstream users of crate or std functionality that have no ability to avoid this blocking behavior this change causes Rust to read bytes from /dev/urandom while getrandom() would block and once getrandom() is available to use that. Fixes #32953. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-05-06Auto merge of #33072 - tbu-:pr_duration_new_overflow, r=alexcrichtonbors-1/+7
Panic on overflow in `Duration::new` constructor Panicking on overflow is also done for `+`, and it replaces the currently incorrect overflow behavior of wrapping around, which does not make sense for `Duration`s.
2016-05-05Auto merge of #32990 - tbu-:pr_more_defaults_cstr_path, r=alexcrichtonbors-0/+16
Add `Default` implementation for `&CStr`, `CString`, `Path`
2016-05-05doc: make RFC references consistentGeorg Brandl-5/+5
2016-05-05Fix some some duplicate words.Georg Brandl-2/+2
2016-05-05Add `Default` implementation for `&CStr` and `CString`Tobias Bucher-0/+16
2016-05-02libstd: correct the link to functions in io module documentationRyman-2/+2
Currently the link refers to it's own section of the documentation rather than the list of functions generated by rustdoc.
2016-05-02std::thread docs: spawn() returns not a Thread anymoreGeorg Brandl-15/+14
Also move the "Thread type" section down a bit, since it is not so important anymore. Fixes: #33321
2016-05-01Add process types documentationGuillaume Gomez-4/+196
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-28Auto merge of #33211 - alexcrichton:android-back-in-time, r=nagisabors-36/+138
std: Add compatibility with android-9 The Gecko folks currently use Android API level 9 for their builds, so they're requesting that we move back our minimum supported API level from 18 to 9. Turns out, ABI-wise at least, there's not that many changes we need to take care of. The `ftruncate64` API appeared in android-12 and the `log2` and `log2f` APIs appeared in android-18. We can have a simple shim for `ftruncate64` which falls back on `ftruncate` and the `log2` function can be approximated with just `ln(f) / ln(2)`. This should at least get the standard library building on API level 9, although the tests aren't quite happening there just yet. As we seem to be growing a number of Android compatibility shims, they're now centralized in a common `sys::android` module.
2016-04-28Rollup merge of #33152 - bwinterton:master, r=steveklabnikSteve Klabnik-2/+2
Make HashSet::Insert documentation more consistent I have made the HashSet::Insert documentation more consistent in the use of the term 'value' vs 'key'. Also clarified that if _this_ value is present true is returned, instead of the ambiguous 'a value present'. r? @steveklabnik
2016-04-27std: Add compatibility with android-9Alex Crichton-36/+138
The Gecko folks currently use Android API level 9 for their builds, so they're requesting that we move back our minimum supported API level from 18 to 9. Turns out, ABI-wise at least, there's not that many changes we need to take care of. The `ftruncate64` API appeared in android-12 and the `log2` and `log2f` APIs appeared in android-18. We can have a simple shim for `ftruncate64` which falls back on `ftruncate` and the `log2` function can be approximated with just `ln(f) / ln(2)`. This should at least get the standard library building on API level 9, although the tests aren't quite happening there just yet. As we seem to be growing a number of Android compatibility shims, they're now centralized in a common `sys::android` module.
2016-04-26Auto merge of #33142 - tshepang:split-long-line, r=guillaumegomezbors-2/+2
doc: that line was too long
2016-04-26Auto merge of #33203 - Ryman:patch-3, r=alexcrichtonbors-2/+2
libstd: fix typos in thread::LocalKey docs
2016-04-26Rollup merge of #33200 - sfackler:nonblocking-docs, r=alexcrichtonManish Goregaokar-1/+1
Fix reference to TCP in UDP docs Closees #33195
2016-04-26Rollup merge of #33167 - benaryorg:master, r=alexcrichtonManish Goregaokar-0/+2
clarify documentation of TcpStream::connect() for multiple valid addresses I am not sure how the UDP part of the stdlib behaves when passing multiple valid addresses, but it should be mentioned as there are legit use cases for [`impl<'a> ToSocketAddrs for &'a [SocketAddr]`](http://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html), a TCP fallback only being one. Just a little example program for anyone willing to enhance the documentation further: ```rust use std::net::SocketAddr; use std::net::ToSocketAddrs; use std::net::TcpStream; fn main() { let v: Vec<SocketAddr> = vec! [ "127.0.0.1:1338".to_socket_addrs().unwrap().next().unwrap(), "127.0.0.1:1337".to_socket_addrs().unwrap().next().unwrap(), "127.0.0.1:1339".to_socket_addrs().unwrap().next().unwrap(), ]; let stream = TcpStream::connect(&v[..]).unwrap(); } ```
2016-04-25libstd: fix typos in thread::LocalKey docsRyman-2/+2
2016-04-25Fix reference to TCP in UDP docsSteven Fackler-1/+1
Closees #33195
2016-04-24thread tighter span for closures aroundNiko Matsakis-3/+3
Track the span corresponding to the `|...|` part of the closure.
2016-04-23Auto merge of #33124 - sfackler:kill-ipv6-only, r=alexcrichtonbors-64/+0
Remove IPV6_V6ONLY functionality These settings can only be adjusted before bind time, which doesn't make sense in the current set of functionality. These methods are stable, but haven't hit a stable release yet. Closes #33052 [breaking-change] r? @alexcrichton Will also need a backport to the beta.
2016-04-23clarify documentation of TcpStream::connect() for multiple valid addressesbenaryorg-0/+2
Signed-off-by: benaryorg <binary@benary.org>
2016-04-22doc: that line was too longTshepang Lekhonkhobe-2/+2
2016-04-22Make HashSet::Insert documentation more consistentBrayden Winterton-2/+2
2016-04-22Implement `append` for b-trees.Johannes Oertel-6/+4
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-20Remove IPV6_V6ONLY functionalitySteven Fackler-64/+0
These settings can only be adjusted before bind time, which doesn't make sense in the current set of functionality. These methods are stable, but haven't hit a stable release yet. Closes #33052 [breaking-change]
2016-04-20rand: add comments about getrandom() fallbackDoug Goldstein-0/+8
Add some comments so that people know why we are performing a fallback from getrandom() and what that fallback aims to achieve. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-20HashMap: add info to docs about random seed qualityDoug Goldstein-2/+4
The random functions that HashMap use make no guarantees about the quality of random data so this documents that to the user so that they are aware. This was brought about by the change to the Linux random code to not block until the urandom pool was initialized to avoid users of crates that internally use HashMap being caught unaware and having their application block until the urandom pool is initialized. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-19rand: don't block before random pool is initializedDoug Goldstein-1/+8
If we attempt a read with getrandom() on Linux the syscall can block before the random pool is initialized unless the GRND_NONBLOCK flag is passed. This flag causes getrandom() to instead return EAGAIN while the pool is uninitialized. To avoid downstream users of crate or std functionality that have no ability to avoid this blocking behavior this change causes Rust to read bytes from /dev/urandom while getrandom() would block and once getrandom() is available to use that. Fixes #32953. Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-18Panic on overflow in `Duration::new` constructorTobias Bucher-1/+7
Panicking on overflow is also done for `+`, and it replaces the currently incorrect overflow behavior of wrapping around, which does not make sense for `Duration`s.
2016-04-17Auto merge of #33034 - tbu-:pr_doc_mutex_lock, r=nagisabors-0/+9
Add a comment about locking a `Mutex` multiple times Fixes #32260.
2016-04-17Add a comment about locking a `Mutex` multiple timesTobias Bucher-0/+9
Fixes #32260.
2016-04-17Rollup merge of #33022 - Mr4x:master, r=blussManish Goregaokar-2/+2
Fix f32::sin_cos and f64::sin_cos examples
2016-04-16Auto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichtonbors-1/+0
Remove unused trait imports
2016-04-16Fix f32::sin_cos and f64::sin_cos examplesMaxim Samburskiy-2/+2
2016-04-15Auto merge of #32785 - tbu-:pr_more_defaults, r=alexcrichtonbors-0/+21
Implement `Default` for more types in the standard library Also add `Hash` to `std::cmp::Ordering` and most possible traits to `fmt::Error`.
2016-04-15Auto merge of #32338 - lukaspustina:doc-std-process, r=alexcrichtonbors-11/+37
Extends rustdoc on how to caputure output - The documentation is quite about how to caputure a process' output when using ` std::process::Child::wait_with_output()`. - This PR adds an example for this particular use case.
2016-04-15Implement `Default` for more types in the standard libraryTobias Bucher-0/+21
Also add `Hash` to `std::cmp::Ordering` and most possible traits to `fmt::Error`.
2016-04-14Rollup merge of #32940 - birkenfeld:patch-3, r=alexcrichtonSteve Klabnik-2/+2
Fix a typo and add a missing word
2016-04-14Rollup merge of #32855 - troplin:take-bufread-fix, r=alexcrichtonSteve Klabnik-0/+12
Don't read past limit for in BufRead instance of Take Similar to `Read::read`, `BufRead::fill_buf` impl of `Take` should not call `inner.fill_buf` if the limit is already reached.
2016-04-13Fix a typo and add a missing wordGeorg Brandl-2/+2
2016-04-13Auto merge of #32726 - asomers:master, r=alexcrichtonbors-7/+25
Fix stack overflow detection on FreeBSD
2016-04-12Auto merge of #31963 - barosl:rename-doc, r=alexcrichtonbors-1/+8
Describe more platform-specific behaviors of `std::fs::rename` I did some tests myself regarding the situation when both `from` and `to` exist, and the results were: On Linux: `from` | `to` | Result ---- | ---- | ---- Directory | Directory | Ok Directory | File | Error File | Directory | Error File | File | Ok On Windows: `from` | `to` | Result ---- | ---- | ---- Directory | Directory | Error Directory | File | Ok File | Directory | Error File | File | Ok This is a bit against the official MSDN documentation, which says "(`MOVEFILE_REPLACE_EXISTING`) cannot be used if `lpNewFileName` or `lpExistingFileName` names a directory." As evidenced above, `lpExistingFileName` *can* be a directory. I also mentioned the atomicity of the operation. Fixes #31301.
2016-04-12Remove unused trait importsSeo Sanghyeon-1/+0
2016-04-12Auto merge of #32804 - alexcrichton:stabilize-1.9, r=brsonbors-146/+259
std: Stabilize APIs for the 1.9 release 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