about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-04-30Remove unnecessary 'mut' qualifier on doc-comment varCorey Farwell-1/+1
The variable doesn't need to be mutable.
2015-04-30std: Destabilize io::BufStreamAlex Crichton-10/+18
As pointed out in #17136 the semantics of a `BufStream` aren't always what one expects, and it looks like other [languages like C#][c-sharp] implement a buffered stream with only one underlying buffer. For now this commit destabilizes the primitive in the `std::io` module to give us some more time in figuring out what to do with it. [c-sharp]: https://msdn.microsoft.com/en-us/library/system.io.bufferedstream%28v=vs.110%29.aspx [breaking-change]
2015-04-30remove denied unused import: pid_t in rawSébastien Marie-4/+4
- unbreak the build under openbsd - while here, apply same modification to dragonfly, freebsd, ios (pid_t imported, but not used in raw.rs)
2015-04-30Fixed iOS buildValerii Hiora-1/+1
2015-04-30Auto merge of #24960 - tynopex:patch-doc, r=alexcrichtonbors-13/+16
- Removed misleading comments about now-defunct CreatePipe - Actually use std::process::Child in it's example - Minor cleanups
2015-04-29Test fixes and rebase conflictsAlex Crichton-1/+0
2015-04-29rollup merge of #24921: tamird/bitflags-associated-constAlex Crichton-10/+10
Conflicts: src/librustc/lib.rs
2015-04-29rollup merge of #24873: alexcrichton/fix-windows-stdioAlex Crichton-177/+138
Conflicts: src/libstd/sys/windows/fs2.rs
2015-04-29rollup merge of #24961: nham/net_docs_cleanupAlex Crichton-39/+39
Changes made include adding missing punctuation, adding missing words, and converting uses of "Gets" to "Returns" in libstd/net/addr.rs to make it more consistent with the other documentation. Fixes #24925.
2015-04-29rollup merge of #24926: frewsxcv/patch-20Alex Crichton-1/+1
2015-04-29rollup merge of #24908: inrustwetrust/once_memory_orderingAlex Crichton-1/+5
`call_once` guarantees that there is a happens-before relationship between its closure and code following it via the sequentially consistent atomic store/loads of `self.cnt`.
2015-04-29rollup merge of #24904: steveklabnik/remove_std_net_warningAlex Crichton-4/+1
This is served by stability markers.
2015-04-29rollup merge of #24711: alexcrichton/fs2.1Alex Crichton-746/+2437
This commit is an implementation of [RFC 1044][rfc] which adds additional surface area to the `std::fs` module. All new APIs are `#[unstable]` behind assorted feature names for each one. [rfc]: https://github.com/rust-lang/rfcs/pull/1044 The new APIs added are: * `fs::canonicalize` - bindings to `realpath` on unix and `GetFinalPathNameByHandle` on windows. * `fs::symlink_metadata` - similar to `lstat` on unix * `fs::FileType` and accessor methods as `is_{file,dir,symlink}` * `fs::Metadata::file_type` - accessor for the raw file type * `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows but requires a syscall on unix. * `fs::DirEntry::file_type` - access the file type which may not require a syscall on most platforms. * `fs::DirEntry::file_name` - access just the file name without leading components. * `fs::PathExt::symlink_metadata` - convenience method for the top-level function. * `fs::PathExt::canonicalize` - convenience method for the top-level function. * `fs::PathExt::read_link` - convenience method for the top-level function. * `fs::PathExt::read_dir` - convenience method for the top-level function. * `std::os::raw` - type definitions for raw OS/C types available on all platforms. * `std::os::$platform` - new modules have been added for all currently supported platforms (e.g. those more specific than just `unix`). * `std::os::$platform::raw` - platform-specific type definitions. These modules are populated with the bare essentials necessary for lowing I/O types into their raw representations, and currently largely consist of the `stat` definition for unix platforms. This commit also deprecates `Metadata::{modified, accessed}` in favor of inspecting the raw representations via the lowering methods of `Metadata`. Closes https://github.com/rust-lang/rust/issues/24796
2015-04-29Update process.rstynopex-8/+8
Make whitespace consistent
2015-04-29Improve libstd/net/addr.rs documentation.Nick Hamann-9/+9
This adds some missing punctuation and converts uses of "Gets" to "Returns". This sounds better to my ear, but more importantly is more consistent with the documentation from other files.
2015-04-29Add some missing punctuation in the libstd/net/tcp.rs docs.Nick Hamann-1/+1
2015-04-29Add some missing punctuation in the libstd/net/ip.rs docs.Nick Hamann-19/+19
2015-04-29std: Fixup docs for std::processtynopex-13/+16
2015-04-29Improve libstd/net/udp.rs documentation.Nick Hamann-10/+10
This adds some missing punctuation, adds a missing word, and corrects a bug in the description of `send_to`, which actually returns the number of bytes written on success. Fixes #24925.
2015-04-29FalloutTamir Duberstein-8/+9
2015-04-29`bitflags!` is no longer used in `std`Tamir Duberstein-2/+1
2015-04-29std: Fix inheriting standard handles on windowsAlex Crichton-177/+138
Currently if a standard I/O handle is set to inherited on Windows, no action is taken and the slot in the process information description is set to `INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however, this means that the handle is actually set to nothing and if a child tries to print it will generate an error. This commit fixes this behavior by explicitly creating stdio handles to be placed in these slots by duplicating the current process's I/O handles. This is presumably what previously happened silently by using a file-descriptor-based implementation instead of a `HANDLE`-centric implementation. Along the way this cleans up a lot of code in `Process::spawn` for Windows by ensuring destructors are always run, using more RAII, and limiting the scope of `unsafe` wherever possible.
2015-04-28Fix punctuation placement in doc-commentCorey Farwell-1/+1
2015-04-28std: Implement fs::DirBuilderAlex Crichton-17/+103
This is the last remaining portion of #24796
2015-04-28Register new snapshotsTamir Duberstein-70/+2
2015-04-28Auto merge of #24777 - alexcrichton:musl, r=brsonbors-5/+17
These commits build on [some great work on reddit](http://www.reddit.com/r/rust/comments/33boew/weekend_experiment_link_rust_programs_against/) for adding MUSL support to the compiler. This goal of this PR is to enable a `--target x86_64-unknown-linux-musl` argument to the compiler to work A-OK. The outcome here is that there are 0 compile-time dependencies for a MUSL-targeting build *except for a linker*. Currently this also assumes that MUSL is being used for statically linked binaries so there is no support for dynamically linked binaries with MUSL. MUSL support largely just entailed munging around with the linker and where libs are located, and the major highlights are: * The entirety of `libc.a` is included in `liblibc.rlib` (statically included as an archive). * The entirety of `libunwind.a` is included in `libstd.rlib` (like with liblibc). * The target specification for MUSL passes a number of ... flavorful options! Each option is documented in the relevant commit. * The entire test suite currently passes with MUSL as a target, except for: * Dynamic linking tests are all ignored as it's not supported with MUSL * Stack overflow detection is not working MUSL yet (I'm not sure why) * There is a language change included in this PR to add a `target_env` `#[cfg]` directive. This is used to conditionally build code for only MUSL (or for linux distros not MUSL). I highly suspect that this will also be used by Windows to target MSVC instead of a MinGW-based toolchain. To build a compiler targeting MUSL you need to follow these steps: 1. Clone the current MUSL repo from `git://git.musl-libc.org/musl`. Build this as usual and install it. 2. Clone and build LLVM's [libcxxabi](http://libcxxabi.llvm.org/) library. Only the `libunwind.a` artifact is needed. I have tried using upstream libunwind's source repo but I have not gotten unwinding to work with it unfortunately. Move `libunwind.a` adjacent to MUSL's `libc.a` 3. Configure a Rust checkout with `--target=x86_64-unknown-linux-musl --musl-root=$MUSL_ROOT` where `MUSL_ROOT` is where you installed MUSL in step 1. I hope to improve building a copy of libunwind as it's still a little sketchy and difficult to do today, but other than that everything should "just work"! This PR is not intended to include 100% comprehensive support for MUSL, as future modifications will probably be necessary.
2015-04-28Clarify Once::call_once memory ordering guarantees in docsinrustwetrust-1/+5
2015-04-28remove stability note from std::netSteve Klabnik-4/+1
This is served by stability markers.
2015-04-27std: Expand the area of std::fsAlex Crichton-729/+2334
This commit is an implementation of [RFC 1044][rfc] which adds additional surface area to the `std::fs` module. All new APIs are `#[unstable]` behind assorted feature names for each one. [rfc]: https://github.com/rust-lang/rfcs/pull/1044 The new APIs added are: * `fs::canonicalize` - bindings to `realpath` on unix and `GetFinalPathNameByHandle` on windows. * `fs::symlink_metadata` - similar to `lstat` on unix * `fs::FileType` and accessor methods as `is_{file,dir,symlink}` * `fs::Metadata::file_type` - accessor for the raw file type * `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows but requires a syscall on unix. * `fs::DirEntry::file_type` - access the file type which may not require a syscall on most platforms. * `fs::DirEntry::file_name` - access just the file name without leading components. * `fs::PathExt::symlink_metadata` - convenience method for the top-level function. * `fs::PathExt::canonicalize` - convenience method for the top-level function. * `fs::PathExt::read_link` - convenience method for the top-level function. * `fs::PathExt::read_dir` - convenience method for the top-level function. * `std::os::raw` - type definitions for raw OS/C types available on all platforms. * `std::os::$platform` - new modules have been added for all currently supported platforms (e.g. those more specific than just `unix`). * `std::os::$platform::raw` - platform-specific type definitions. These modules are populated with the bare essentials necessary for lowing I/O types into their raw representations, and currently largely consist of the `stat` definition for unix platforms. This commit also deprecates `Metadata::{modified, accessed}` in favor of inspecting the raw representations via the lowering methods of `Metadata`.
2015-04-27std: Don't assume thread::current() works on panicAlex Crichton-11/+12
Inspecting the current thread's info may not always work due to the TLS value having been destroyed (or is actively being destroyed). The code for printing a panic message assumed, however, that it could acquire the thread's name through this method. Instead this commit propagates the `Option` outwards to allow the `std::panicking` module to handle the case where the current thread isn't present. While it solves the immediate issue of #24313, there is still another underlying issue of panicking destructors in thread locals will abort the process. Closes #24313
2015-04-27std: Clean up some annotations in thread::localAlex Crichton-20/+4
Don't need so much manual #[doc(hidden)] and #[unstable] as much of it is inherited!
2015-04-27std: Don't assume dlopen() works on yourselfAlex Crichton-1/+4
Statically linked executables do not succeed (aka MUSL-based executables).
2015-04-27std: Prepare for linking to muslAlex Crichton-4/+13
This commit modifies the standard library and its dependencies to link correctly when built against MUSL. This primarily ensures that the right libraries are linked against and when they're linked against they're linked against statically.
2015-04-27Rollup merge of #24855 - richo:thread-doc, r=alexcrichtonSteve Klabnik-2/+1
2015-04-27Auto merge of #24820 - bradking:fix-windows-process-spawn-command-line, ↵bors-18/+21
r=alexcrichton Fix `make_command_line` for the case of backslashes at the end of an argument requiring quotes. We must encode the command and arguments such that `CommandLineToArgvW` recovers them in the spawned process. Simplify the logic by using a running count of backslashes as they are encountered instead of looking ahead for quotes following them. Extend `test_make_command_line` to additionally cover: * a leading quote in an argument that requires quotes, * a backslash before a quote in an argument that requires quotes, * a backslash at the end of an argument that requires quotes, and * a backslash at the end of an argument that does not require quotes.
2015-04-26thread: right now you can't actually set those printersRicho Healey-2/+1
2015-04-25std: Fix process spawn for arguments ending in backslashes on WindowsBrad King-18/+21
Fix `make_command_line` for the case of backslashes at the end of an argument requiring quotes. We must encode the command and arguments such that `CommandLineToArgvW` recovers them in the spawned process. Simplify the logic by using a running count of backslashes as they are encountered instead of looking ahead for quotes following them. Extend `test_make_command_line` to additionally cover: * a leading quote in an argument that requires quotes, * a backslash before a quote in an argument that requires quotes, * a backslash at the end of an argument that requires quotes, and * a backslash at the end of an argument that does not require quotes.
2015-04-25add import (fixup #24649)Manish Goregaokar-0/+2
2015-04-25Rollup merge of #24649 - nham:path_new_examples, r=steveklabnikManish Goregaokar-0/+8
2015-04-25Auto merge of #24783 - jooert:unittestguidelines, r=alexcrichtonbors-14/+14
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions). r? @alexcrichton
2015-04-25Auto merge of #24724 - alexcrichton:symlink-stable, r=aturonbors-0/+3
These functions were intended to be introduced as `#[stable]` as a stable API was deprecated in favor of them, but they just erroneously forgot the stability attributes.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-14/+14
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-24Auto merge of #24594 - doomsplayer:patch-2, r=alexcrichtonbors-2/+6
why use dummy implementation on linux?
2015-04-24Rollup merge of #24706 - tamird:remove-DST-comment, r=alexcrichtonManish Goregaokar-8/+0
`ToCStr` was removed with `old_io` and the current method `as_os_str` is inherent to `Path`, meaning there is no suitable trait bound that could be used here. r? @alexcrichton
2015-04-24Rollup merge of #24699 - mbrubeck:doc-edit, r=steveklabnikManish Goregaokar-0/+4
r? @steveklabnik
2015-04-23Auto merge of #24633 - rapha:master, r=alexcrichtonbors-0/+57
2015-04-24Implement IntoIterator for ReceiverRaphael Speyer-0/+57
2015-04-23std: Add missing stability for symlink functionsAlex Crichton-0/+3
These functions were intended to be introduced as `#[stable]` as a stable API was deprecated in favor of them, but they just erroneously forgot the stability attributes.
2015-04-23Indicate trait names in doc-comment are code-likeCorey Farwell-1/+1
2015-04-23implement set_tcp_keepalive for linuxYoung Wu-2/+6