about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-04-09Auto merge of #40829 - mgattozzi:ChildStderr, r=steveklabnikbors-2/+3
Update ChildStderr docs to be clearer Before the docs only had a line about where it was found and that it was a handle to stderr. This commit changes it so that the summary second line is removed and that it's a bit clearer about what can be done with it. Part of #29370
2017-04-09Auto merge of #41095 - clarcharr:as_extras, r=alexcrichtonbors-0/+6
Add as_c_str Again, tying up some consistencies with `CString`.
2017-04-07Add as_c_str.Clar Charr-0/+6
2017-04-07Rollup merge of #41120 - clarcharr:c_str_transmute, r=alexcrichtonCorey Farwell-2/+3
Remove some CStr transmutes. Because dedicated methods exist for these, we don't have to add other transmutes.
2017-04-06Remove some CStr transmutes.Clar Charr-2/+3
2017-04-06Rollup merge of #41111 - ollie27:docs_markdown_fix, r=GuillaumeGomezCorey Farwell-23/+40
Fix Markdown issues in the docs * Since the switch to pulldown-cmark reference links need a blank line before the URLs. (#40912) * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
2017-04-06Rollup merge of #41090 - rap2hpoutre:patch-2, r=steveklabnikCorey Farwell-0/+21
Add example to std::process::abort This is a second step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370 I submitted this PR with the help of @steveklabnik again. Thanks to him! More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290653877
2017-04-06Fix Markdown issues in the docsOliver Middleton-23/+40
* Since the switch to pulldown-cmark reference links need a blank line before the URLs. * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
2017-04-06Auto merge of #41039 - alexcrichton:process-poll, r=nagisabors-13/+9
std: Use `poll` instead of `select` This gives us the benefit of supporting file descriptors over the limit that select supports, which... Closes #40894
2017-04-06Update process.rsraph-3/+2
2017-04-05Rollup merge of #41054 - anatol:master, r=alexcrichtonAriel Ben-Yehuda-1/+1
Replace magic number with readable sig constant SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'
2017-04-05Rollup merge of #40561 - arthurprs:hm-adapt2, r=pczarnAriel Ben-Yehuda-191/+165
Simplify HashMap Bucket interface > Simplify HashMap Bucket interface > > * Store capacity_mask instead of capacity > * Move bucket index into RawBucket > * Valid bucket index is now always within [0..table_capacity) > * Simplify iterators by moving logic into RawBuckets > * Clone RawTable using RawBucket > * Make retain aware of the number of elements The idea was to put idx in RawBucket instead of the other Bucket types and simplify next() and prev() as much as possible. The rest was a side-effect of that change, except maybe the last 2. This change makes iteration and other next/prev() heavy operations noticeably faster. Clone is way faster. ``` ➜ hashmap2 git:(adapt) ✗ cargo benchcmp pre:: adp:: bench.txt name pre:: ns/iter adp:: ns/iter diff ns/iter diff % clone_10_000 74,364 39,736 -34,628 -46.57% grow_100_000 8,343,553 8,233,785 -109,768 -1.32% grow_10_000 817,825 723,958 -93,867 -11.48% grow_big_value_100_000 18,418,979 17,906,186 -512,793 -2.78% grow_big_value_10_000 1,219,242 1,103,334 -115,908 -9.51% insert_1000 74,546 58,343 -16,203 -21.74% insert_100_000 6,743,770 6,238,017 -505,753 -7.50% insert_10_000 798,079 719,123 -78,956 -9.89% insert_1_000_000 275,215,605 266,975,875 -8,239,730 -2.99% insert_int_bigvalue_10_000 1,517,387 1,419,838 -97,549 -6.43% insert_str_10_000 316,179 278,896 -37,283 -11.79% insert_string_10_000 770,927 747,449 -23,478 -3.05% iter_keys_100_000 386,099 333,104 -52,995 -13.73% iterate_100_000 387,320 355,707 -31,613 -8.16% lookup_100_000 206,757 193,063 -13,694 -6.62% lookup_100_000_unif 219,366 193,180 -26,186 -11.94% lookup_1_000_000 206,456 205,716 -740 -0.36% lookup_1_000_000_unif 659,934 629,659 -30,275 -4.59% lru_sim 20,194,334 18,442,149 -1,752,185 -8.68% merge_shuffle 1,168,044 1,063,055 -104,989 -8.99% ``` Note 2: I may have messed up porting the diff, let's see what CI says.
2017-04-05Add example to std::process::abortraph-0/+22
This is a second (2/3?) step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370 I submitted this PR with the help of @steveklabnik again. Thanks to him! More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290653877
2017-04-05Rollup merge of #41035 - jmesmon:revert-bad-raw-fd-impls, r=aturonCorey Farwell-15/+0
Revert "Implement AsRawFd/IntoRawFd for RawFd" This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842) RawFd is a type alias for c_int, which is itself a type alias for i32. As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds them for i32. As a result, the reverted commit makes this valid: ``` use std::os::unix::io::AsRawFd; fn arf<T: AsRawFd>(_: T) {} fn main() { arf(32i32) } ``` Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both those traits that their methods return a valid RawFd. r? @aturon cc @Mic92 @kamalmarhubi
2017-04-05Rollup merge of #41014 - SimonSapin:patch-6, r=frewsxcvCorey Farwell-1/+1
std::thread docs: fix link to current()
2017-04-05Rollup merge of #41007 - pgerber:dir_builder, r=frewsxcvCorey Farwell-3/+6
Improve documentation for `std::fs::DirBuilder`
2017-04-05Rollup merge of #40988 - eugene-bulkin:ascii-docs, r=frewsxcvCorey Farwell-8/+58
API Docs: ascii Add/update docs for the `ascii` module per #29341. r? @steveklabnik
2017-04-05Rollup merge of #40981 - Technius:master, r=steveklabnikCorey Farwell-46/+172
Add links and some examples to std::sync::mpsc docs Addresses part of #29377 r? @steveklabnik I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples. Edit: Whoops, typed in `?r` instead of `r?`.
2017-04-05Rollup merge of #40977 - projektir:BarrierWaitResult_doc, r=steveklabnikCorey Farwell-5/+4
Updating the description for BarrierWaitResult #29377 Referencing `Barrier`, removing reference to `is_leader`.
2017-04-05Rollup merge of #40608 - GuillaumeGomez:mutex-doc-inconsistency, r=steveklabnikCorey Farwell-7/+7
Fix mutex's docs inconsistency Fixes #40176. r? @steveklabnik cc @rust-lang/docs
2017-04-04Simplify HashMap Bucket interfacearthurprs-191/+165
* Store capacity_mask instead of capacity * Move bucket index into RawBucket * Bucket index is now always within [0..table_capacity) * Clone RawTable using RawBucket * Simplify iterators by moving logic into RawBuckets * Make retain aware of the number of elements
2017-04-04Change docs to follow review requestsMichael Gattozzi-3/+3
2017-04-04std: Use `poll` instead of `select`Alex Crichton-13/+9
This gives us the benefit of supporting file descriptors over the limit that select supports, which... Closes #40894
2017-04-03Replace magic number with readable sig constantAnatol Pomozov-1/+1
SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'
2017-04-03Fix styling issuesBryan Tan-6/+17
2017-04-03Fix mutex's docs inconsistencyGuillaume Gomez-7/+7
2017-04-03Revert "Implement AsRawFd/IntoRawFd for RawFd"Cody P Schafer-15/+0
This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842) RawFd is a type alias for c_int, which is itself a type alias for i32. As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds them for i32. As a result, the reverted commit makes this valid: ``` use std::os::unix::io::AsRawFd; fn arf<T: AsRawFd>(_: T) {} fn main() { arf(32i32) } ``` Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both those traits that their methods return a valid RawFd. r? @aturon cc @Mic92 @kamalmarhubi
2017-04-02std::thread docs: fix link to current()Simon Sapin-1/+1
2017-04-02Improve documentation for `std::fs::DirBuilder`Peter Gerber-3/+6
2017-04-01Add more std::ascii module-level docs.Eugene Bulkin-0/+14
2017-04-01Clean up std::ascii sub-level docs.Eugene Bulkin-8/+44
* Change `utf8` variable names to `non_ascii` to be more clear, since ASCII and UTF-8 are compatible. * Fix `EscapeDefault` struct description to follow the typical iterator method format with a link to the generating function. * Add more `escape_default` examples to cover every case mentioned in the function description itself.
2017-03-31Fix warnings in examplesBryan Tan-9/+9
2017-03-31Fix broken links to std::iter::Iterator::nextBryan Tan-2/+2
2017-03-31Add links and examples to std::sync::mpsc docs (#29377)Bryan Tan-31/+136
This change adds links to to `Receiver`, `Iter`, `TryIter`, `IntoIter`, `Sender`, `SyncSender`, `SendError`, `RecvError`, `TryRecvError`, `RecvTimeoutError`, `TrySendError`, `Sender::send`, `SyncSender::send`, `SyncSender::try_send`, `Receiver::recv`, `Receiver::recv_timeout`, `Receiver::iter`, and `Receiver::try_iter`. Examples added to `Receiver`, `Sender`, `Receiver::iter`.
2017-03-31Updating the description for BarrierWaitResult #29377projektir-5/+4
2017-03-31Rollup merge of #40763 - pirate:patch-2, r=steveklabnikCorey Farwell-0/+12
Add helpful hint in io docs about how ? is not allowed in main() This is my effort to help alleviate the confusion caused by the error message: ```rust error[E0277]: the trait bound `(): std::ops::Carrier` is not satisfied --> hello_world.rs:72:5 | 72 | io::stdin().read_line(&mut d_input)?; | ------------------------------------ | | | the trait `std::ops::Carrier` is not implemented for `()` | in this macro invocation | = note: required by `std::ops::Carrier::from_error` error: aborting due to previous error ``` This has been discussed at length in https://github.com/rust-lang/rust/issues/35946, but I figured it would be helpful to mention in the docs. Reading user input is one of the first things beginners will look up in the docs, so my thinking was they'd see this warning here and not have to deal with the [tricky error message](https://blog.rust-lang.org/2017/03/02/lang-ergonomics.html). If you think this isn't the right place to put this in the docs, that's understandable, I'm open to suggestions for putting it elsewhere or removing it entirely.
2017-03-31Rollup merge of #40703 - GuillaumeGomez:pointer-docs, r=steveklabnikCorey Farwell-4/+9
Add missing urls in ptr docs r? @rust-lang/docs
2017-03-31Rollup merge of #40904 - rap2hpoutre:patch-1, r=steveklabnikCorey Farwell-0/+14
Add example to std::process::abort This is a first step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370 I submitted this PR with the help of @steveklabnik More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290089330 It's my first PR on Rust, I'm learning how to contribute: Should I ping someone? I will post another PR with a more complicated example soon, I prefer send it separately (cause maybe I made some mistakes).
2017-03-31Rollup merge of #40869 - ctjhoa:master, r=steveklabnikCorey Farwell-0/+19
Improve os::linux documentation (#29367) Improve `os::linux` documentation according to #29367 r? @steveklabnik
2017-03-31Rollup merge of #40842 - Mic92:RawFd, r=aturonCorey Farwell-0/+15
Implement AsRawFd/IntoRawFd for RawFd This is useful to build os abstraction like the nix crate does. It allows to define functions, which accepts generic arguments of data structures convertible to RawFd, including RawFd itself. For example: ``` fn write<FD: AsRawFd>(fd: FD, buf: &[u8]) -> Result<usize> write(file, buf); ``` instead of: ``` fn write(fd: RawFd, buf: &[u8]) -> Result<usize> write(file.as_raw_fd(), buf); ``` cc @kamalmarhubi
2017-03-30Add links to std::sync::mpsc docs #29377Bryan Tan-15/+25
2017-03-30Replace hardcoded forward slash with path::MAIN_SEPARATORThomas Jespersen-2/+2
Fixes #40149
2017-03-30Update process.rsraph-1/+1
2017-03-29Improve os::linux documentation (#29367)Camille TJHOA-0/+19
2017-03-29Removing trailing spacesraph-3/+3
2017-03-29adding ///raph-0/+1
2017-03-29Add example to std::process::abortraph-0/+13
2017-03-29Rollup merge of #40866 - projektir:once_docs, r=estebankCorey Farwell-8/+29
Adding linking for Once docs #29377 Linking everything around `Once`, `ONCE_INIT`, and `OnceState`.
2017-03-29Adding linking for Once docs #29377projektir-8/+29
2017-03-28Rollup merge of #40838 - lukaramu:std-net-docs, r=GuillaumeGomezCorey Farwell-140/+476
Improve std::net docs Fixes #29363 Summary: * Added a _lot_ of missing links, both to other types/methods and to IETF RFCs, and changed occurences of just "RFC" to "IETF RFC" * Expanded a bunch of top-level docs, specifically the module docs & the docs for `TcpListener`, `TcpStream`, `UdpSocket`, `IpAddr`, `Ipv4Addr`, `Ipv6Addr`, `SocketAddr`, `SocketAddrV4`, `SocketAddrV6`, * Expanded method docs for `SocketAddrV6`, `AddrParseError`, * Various edits for clarity, consistency, and accuracy See the commit descriptions for more detail. Things not done quite as laid out in the task list in #29363: * `AddrParseError` still doesn't have examples, but I wasn't quite sure how to do them; other `FromStr` error types don't have any, either * I didn't link to an IETF RFC in `IpAddr`, but in `Ipv4Addr` and `Ipv6Addr` and linked tho those from `IpAddr`; this seems more appropriate to me * Similarly, I didn't really exand `SocketAddr`'s docs, but elaborated on `SocketAddrV4` and `SocketAddrV6`'s and linked to them from `SocketAddr` Theres definitely still room for improvement, but this should be a good first effort :smile: