summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-02-04libstd/net: Add `peek` APIs to UdpSocket and TcpStreamTyler Julian-16/+250
These methods enable socket reads without side-effects. That is, repeated calls to peek() return identical data. This is accomplished by providing the POSIX flag MSG_PEEK to the underlying socket read operations. This also moves the current implementation of recv_from out of the platform-independent sys_common and into respective sys/windows and sys/unix implementations. This allows for more platform-dependent implementations.
2017-02-04Rollup merge of #39506 - GuillaumeGomez:hashmap_docs, r=frewsxcvGuillaume Gomez-5/+12
Add missing urls in HashMap r? @frewsxcv
2017-02-04Rollup merge of #39486 - phungleson:tiny-doc-wording-change, r=alexcrichtonGuillaume Gomez-1/+1
Tiny doc wording change Fix https://github.com/rust-lang/rust/issues/39366
2017-02-04Use less syscalls in `FileDesc::set_{nonblocking,cloexec}`Tobias Bucher-2/+17
Only set the flags if they differ from what the OS reported, use `FIONBIO` to atomically set the non-blocking IO flag on Linux.
2017-02-03Auto merge of #39463 - alexcrichton:update-bootstrap, r=alexcrichtonbors-2/+0
Bump version, upgrade bootstrap This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-02-03Add missing urls in HashMapGuillaume Gomez-5/+12
2017-02-03Bump version, upgrade bootstrapAlex Crichton-2/+0
This commit updates the version number to 1.17.0 as we're not on that version of the nightly compiler, and at the same time this updates src/stage0.txt to bootstrap from freshly minted beta compiler and beta Cargo.
2017-02-04tiny doc wording changeSon-1/+1
2017-02-03Auto merge of #39418 - redox-os:redox_fs_ext, r=brsonbors-0/+10
Add dev and ino to MetadataExt This adds .dev() and .ino() to MetadataExt on Redox
2017-02-02Build libbacktrace/jemalloc only when their timestamps are older than sourcesVadim Petrochenkov-7/+12
2017-02-02Fix build in cross-compilation scenariosVadim Petrochenkov-1/+1
2017-02-02rustbuild: Build jemalloc and libbacktrace only once (take 2)Vadim Petrochenkov-16/+10
2017-02-02Auto merge of #39386 - tbu-:pr_pipe_less_syscalls, r=alexcrichtonbors-22/+17
Use less syscalls in `anon_pipe()` Save a `ENOSYS` failure from `pipe2` and don't try again. Use `cvt` instead of `cvt_r` for `pipe2` - `EINTR` is not an error `pipe2` can return.
2017-01-31add From<(I, u16)> for SocketAddr where I: Into<IpAddr>Sean McArthur-2/+9
2017-01-30Add dev and ino to MetadataExtJeremy Soller-0/+10
2017-01-30Don't handle ENOSYS in `anon_pipe()`Tobias Bucher-14/+9
We're not calling the raw syscall but a libc function, the libc will have a compatibility layer.
2017-01-29Add support for test suites emulated in QEMUAlex Crichton-1/+5
This commit adds support to the build system to execute test suites that cannot run natively but can instead run inside of a QEMU emulator. A proof-of-concept builder was added for the `arm-unknown-linux-gnueabihf` target to show off how this might work. In general the architecture is to have a server running inside of the emulator which a local client connects to. The protocol between the server/client supports compiling tests on the host and running them on the target inside the emulator. Closes #33114
2017-01-29Fix a few impl stability attributesOliver Middleton-51/+53
The versions show up in rustdoc.
2017-01-28add From<[u8; n]> impls for IpAddrSean McArthur-0/+22
2017-01-28Auto merge of #39234 - segevfiner:fix-backtraces-on-windows-gnu, r=petrochenkovbors-1/+180
Make backtraces work on Windows GNU targets again. This is done by adding a function that can return a filename to pass to backtrace_create_state. The filename is obtained in a safe way by first getting the filename, locking the file so it can't be moved, and then getting the filename again and making sure it's the same. See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399 Issue: #33985 Note though that this isn't that pretty... I had to implement a `WideCharToMultiByte` wrapper function to convert to the ANSI code page. This will work better than only allowing ASCII provided that the ANSI code page is set to the user's local language, which is often the case. Also, please make sure that I didn't break the Unix build.
2017-01-27Rollup merge of #39344 - ollie27:links, r=steveklabnikAlex Crichton-3/+3
Fix a few links in the docs r? @steveklabnik
2017-01-27Rollup merge of #39307 - alexcrichton:stabilize-1.16, r=brsonAlex Crichton-29/+12
std: Stabilize APIs for the 1.16.0 release This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-28Use libc::c_char instead of i8 due to platforms with unsigned charSegev Finer-2/+4
2017-01-27Use less syscalls in `anon_pipe()`Tobias Bucher-19/+19
Save a `ENOSYS` failure from `pipe2` and don't try again. Use `cvt` instead of `cvt_r` for `pipe2` - `EINTR` is not an error `pipe2` can return.
2017-01-27Fix a few links in the docsOliver Middleton-3/+3
2017-01-27Attempt at fixing dead code lintsSegev Finer-68/+106
2017-01-26std: Compile libbacktrace with -fvisibility=hiddenAlex Crichton-2/+3
We don't want these symbols exported from the standard library, this is just an internal implementation detail of the standard library currently. Closes #34984
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-29/+12
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-25Auto merge of #38856 - zackw:process-envs, r=aturonbors-1/+36
Add std::process::Command::envs() `Command::envs()` adds a vector of key-value pairs to the child process environment all at once. Suggested in #38526. This is not fully baked and frankly I'm not sure it even _works_, but I need some help finishing it up, and this is the simplest way to show you what I've got. The problems I know exist and don't know how to solve, from most to least important, are: * [ ] I don't know if the type signature of the new function is correct. * [x] The new test might not be getting run. I didn't see it go by in the output of `x.py test src/libstd --stage 1`. * [x] The tidy check says ``process.rs:402: different `since` than before`` which I don't know what it means. r? @brson
2017-01-25Rollup merge of #39276 - GuillaumeGomez:array_urls, r=frewsxcvGuillaume Gomez-21/+22
Add missing urls for array docs r? @frewsxcv
2017-01-25Rollup merge of #39212 - redox-os:master, r=brsonGuillaume Gomez-1/+8
Use libc errno in Redox submodule This fixes https://github.com/redox-os/redox/issues/830, and is necessary when using libc in Redox
2017-01-24Updated Fuchsia support for std::process. Adds support for try_wait. Misc. ↵Theodore DeRego-23/+167
updates to reflect changes in Magenta
2017-01-24Make backtraces work on Windows GNU targets again.Segev Finer-1/+140
This is done by adding a function that can return a filename to pass to backtrace_create_state. The filename is obtained in a safe way by first getting the filename, locking the file so it can't be moved, and then getting the filename again and making sure it's the same. See: https://github.com/rust-lang/rust/pull/37359#issuecomment-260123399 Issue: #33985
2017-01-24Add missing urls for array docsGuillaume Gomez-21/+22
2017-01-24Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichtonbors-0/+20
impl ToSocketAddrs for String `ToSocketAddrs` is implemented for a number of different types, including `(IpAddr, u16)`, `&str`, and various others, for the convenience of being able to run things like `TcpListener::bind("10.11.12.13:1415")`. However, because this is a generic parameter with a trait bound, if you have a `String` you cannot pass it in, either directly as `TcpListener::bind(string)`, or the `TcpListener::bind(&string)` as you might expect due to deref coercion; you have to use `TcpListener::bind(&*string)`, which is noisy and hard to discover (though #39029 suggests better error messages to make it more discoverable). Rather than making people stumble over this, just implement `ToSocketAddrs` for `String`.
2017-01-23Rollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomezSteve Klabnik-2/+30
Add more references between lowercase/uppercase operations. None
2017-01-22Auto merge of #38648 - ↵bors-163/+163
utkarshkukreti:question-mark-in-libstd-documentation-examples, r=pnkfelix,steveklabnik,frewsxcvx libstd: replace all `try!` with `?` in documentation examples See #38644. For the record, I used the following Perl one-liner and then manually fixed a couple of things it got wrong: $ perl -p -i -e 's#(///.*)try!\((.*)\)#$1$2?#' src/libstd/**/*.rs
2017-01-22libstd: mention `?` operator instead of removing `try!` macro referenceUtkarsh Kukreti-1/+3
2017-01-22libstd: update std::io module documentation to not mention `try!`Utkarsh Kukreti-3/+1
We're not using it in the examples anymore.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-161/+161
See #38644.
2017-01-22Add more references between lowercase/uppercase operations.Corey Farwell-2/+30
2017-01-22Add missing urls for OsStr and OsStringGuillaume Gomez-9/+28
2017-01-22Auto merge of #39221 - frewsxcv:os-string-docs, r=GuillaumeGomezbors-0/+73
Add doc examples for `std::ffi::OsString` fucntions/methods. None
2017-01-22Auto merge of #39176 - CartesianDaemon:master, r=frewsxcvbors-1/+12
Use fs::symlink_metadata in doc for is_symlink fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
2017-01-21Revert "Add link to symlink_metadata in fs::Metadata doc"Jack Vickeridge-4/+3
This reverts commit fe9f5d52a6830991609c07455b0267852d9c3545.
2017-01-21Auto merge of #39210 - GuillaumeGomez:GuillaumeGomez-patch-1, r=frewsxcvbors-1/+9
Specify the result of integer cast on boolean Fixes #39190. r? @frewsxcv
2017-01-21Auto merge of #39203 - ranma42:doc_metadata, r=BurntSushibors-3/+5
Document that `Metadata` can be obtained from `symlink_metadata` When retrieving the information about a syslink (specifically, when invoking `Metadata::is_symlink`) you generally want the `syslink_metadata`. It would be natural to point at both options to retrieve a `Metadata` value, as they are both appropriate (for different use cases).
2017-01-21Generalize envs() and args() to iterators.Zack Weinberg-6/+9
* Command::envs() now takes anything that is IntoIterator<Item=(K, V)> where both K and V are AsRef<OsStr>. * Since we're not 100% sure that's the right signature, envs() is now marked unstable. (You can use envs() with HashMap<str, str> but not Vec<(str, str)>, for instance.) * Update the test to match. * By analogy, args() now takes any IntoIterator<Item=S>, S: AsRef<OsStr>. This should be uncontroversial.
2017-01-21Add doc examples for `std::ffi::OsString` fucntions/methods.Corey Farwell-0/+73
2017-01-21Specify the result of integer cast on booleanGuillaume Gomez-1/+9