about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-04-03Derive Hash for ThreadId + better exampleStephen M. Coakley-17/+13
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-30tweak linksNick Sweeting-2/+2
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:
2017-03-28Rollup merge of #40783 - stepancheg:cursor-new-0, r=aturonCorey Farwell-0/+4
Document Cursor::new position is 0 ... even if contained `Vec` is not empty. E. g. for ``` let v = vec![10u8, 20]; let mut c = io::Cursor::new(v); c.write_all(b"aaaa").unwrap(); println!("{:?}", c.into_inner()); ``` result is ``` [97, 97, 97, 97] ``` and not ``` [10, 20, 97, 97, 97, 97] ```
2017-03-28add missing importNick Sweeting-0/+2
2017-03-27Rollup merge of #40837 - alanstoate:ascii-docs, r=steveklabnikAlex Crichton-9/+15
change string references in asciiext
2017-03-27Fix tidy errors and simplify exampleNick Sweeting-8/+6
2017-03-27Rollup merge of #40516 - alexcrichton:no-cache-handles, r=aturonAlex Crichton-55/+46
std: Don't cache stdio handles on Windows This alters the stdio code on Windows to always call `GetStdHandle` whenever the stdio read/write functions are called as this allows us to track changes to the value over time (such as if a process calls `SetStdHandle` while it's running). Closes #40490
2017-03-27Rollup merge of #40317 - malbarbo:update-libc, r=alexcrichtonAlex Crichton-10/+35
Update libc to 0.2.21 Update to include android aarch64 and x86 improvements.
2017-03-27Addressed requested changes for PR #40838lukaramu-26/+17
* Fixed spelling ToSocketAddr -> ToSocketAddrs in module docs (which also fixes a link) * Added missing "when" before "interacting" in module docs * Changed SocketAddr's top-level docs to explicitly state what socket addresses consist of, making them more consistent with SocketAddrV4's and SocketAddrV6's docs * Changed "in C" -> "in C's `netinet/in.h`" * Changed wording in is_ipv4/is_ipv6 methods to ", `false` otherwise" * Add missing closing ` ``` ` in Ipv6Addr's examples * Removed "Errors" section in ToSocketAddrs' to_socket_addrs method as it was rather redundant
2017-03-27Fixed spelling mistakesAlan Stoate-2/+2
2017-03-26Implement AsRawFd/IntoRawFd for RawFdJörg Thalheim-0/+15
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> instead of: fn write(fd: RawFd, buf: &[u8]) -> Result<usize> write(foo.as_raw_fd(), buf);
2017-03-26fix trailing whitespacelukaramu-1/+1
2017-03-26Expanded std::net module docslukaramu-0/+26
Part of #29363
2017-03-26Expanded top-level docs for std::net{TcpListener,TcpStream,UdpSocket}lukaramu-9/+58
Part of #29363
2017-03-26Added links to std::net::Shutdown docs and made them more consistentlukaramu-6/+19
Part of #29363
2017-03-26Added examples to std::net::{SocketAddr, SocketAddrV4, SocketAddrV6} docslukaramu-0/+36
2017-03-26Expanded and added links to std::net::{SocketAddr,SocketAddrV4,SocketAddrV6} ↵lukaramu-26/+90
docs Part of #29363 Changed summary sentences of SocketAddr and IpAddr for consistency Linked to SocketAddrV4 and SocketAddrV6 from SocketAddr, moving explaination there Expanded top-level docs for SocketAddrV4 and SocketAddrV6, linking to some relevant IETF RFCs, and linking back to SocketAddr Changed some of the method summaries to third person as per RFC 1574; added links to IETF RFCs where appropriate
2017-03-26Removed link in std::net::ToSocketAddr's summary sentencelukaramu-3/+1
Relative links in trait methods don't resolve in e.g. std/primitive.tuple.html :(
2017-03-26Expanded and added links to std::net::{IpAddr,Ipv4Addr,Ipv6Addr} docslukaramu-42/+160
Part of #29363 Expanded top-level documentation & linked to relevant IETF RFCs. Added a bunch of links (to true/false/Ipv4Addr/etc.) throughout the docs.
2017-03-26Added links to std::net::AddrParseError's documentationlukaramu-1/+13
Additionally changed the summary sentence to be more consistent with most of the other FromStr implementations' error types.
2017-03-26Added links throughout std::net::ToSocketAddrs' documentationlukaramu-17/+35
Part of #29363 In the section about the default implementations of ToSocketAddrs, I moved the bulletpoint of SocketAddrV4 & SocketAddrV6 to the one stating that SocketAddr is constructed trivially, as this is what's actually the case
2017-03-26std::net docs: changed occurences of "RFC" to say "IETF RFC"lukaramu-24/+24
part of #29363
2017-03-26Update std::net:Incoming's docs to use standard iterator boilerplatelukaramu-8/+8
Part of #29363
2017-03-26added missing links in std::net TCP docslukaramu-6/+17
part of #29363
2017-03-26change string references in asciiext r? @steveklabnikaStoate-9/+15
2017-03-25Update ChildStderr docs to be clearerMichael Gattozzi-2/+3
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-03-25Remove extra wait from Child docsMichael Gattozzi-1/+1