about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-05-06doc: binding not neededTshepang Lekhonkhobe-2/+1
2016-05-06doc: mut not neededTshepang Lekhonkhobe-1/+1
2016-05-06Indicate struct names are code-like in doc-comment.Corey Farwell-2/+2
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-06Fix Typo in Barrier::wait documentationChristopher Serr-1/+1
This should be `have` instead of `has`.
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-03Fix build on WindowsSeo Sanghyeon-1/+0
2016-05-03Remove unused trait imports flagged by lintSeo Sanghyeon-2/+0
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-28Fix a typo in error messages in std::fs testsSimon Wollwage-2/+2
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-26std: Allow creating ExitStatus from raw valuesAlex Crichton-0/+42
Sometimes a process may be waited on externally from the standard library, in which case it can be useful to create a raw `ExitStatus` structure to return. This commit extends the existing Unix `ExitStatusExt` extension trait and adds a new Windows-specific `ExitStatusExt` extension trait to do this. The methods are currently called `ExitStatus::from_raw`. cc #32713
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