summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-02-04Allow dead code for `symlink_junction()`Paul Dicker-0/+2
2016-02-04Auto merge of #31161 - sfackler:slice-to-socket-addrs, r=alexcrichtonbors-0/+11
This is useful when you have an API that takes a `T: ToSocketAddrs` and needs to turn that into an owned value which will be passed to another API taking `T: ToSocketAddrs` at a later time, for example: https://github.com/sfackler/rust-hyper-socks/blob/master/src/lib.rs#L15
2016-02-04Auto merge of #31069 - sfackler:file-try-clone, r=alexcrichtonbors-39/+87
I have it set as stable right now under the rationale that it's extending an existing, stable API to another type in the "obvious" way. r? @alexcrichton cc @reem
2016-02-04Implement ToSocketAddrs for &[SocketAddr]Steven Fackler-0/+11
2016-02-04Add File::try_cloneSteven Fackler-39/+87
2016-02-04Auto merge of #30796 - GuillaumeGomez:impl_box_error, r=alexcrichtonbors-0/+11
Fixes #30349
2016-02-03Auto merge of #31078 - nbaksalyar:illumos, r=alexcrichtonbors-30/+272
This pull request adds support for [Illumos](http://illumos.org/)-based operating systems: SmartOS, OpenIndiana, and others. For now it's x86-64 only, as I'm not sure if 32-bit installations are widespread. This PR is based on #28589 by @potatosalad, and also closes #21000, #25845, and #25846. Required changes in libc are already merged: https://github.com/rust-lang-nursery/libc/pull/138 Here's a snapshot required to build a stage0 compiler: https://s3-eu-west-1.amazonaws.com/nbaksalyar/rustc-sunos-snapshot.tar.gz It passes all checks from `make check`. There are some changes I'm not quite sure about, e.g. macro usage in `src/libstd/num/f64.rs` and `DirEntry` structure in `src/libstd/sys/unix/fs.rs`, so any comments on how to rewrite it better would be greatly appreciated. Also, LLVM configure script might need to be patched to build it successfully, or a pre-built libLLVM should be used. Some details can be found here: https://llvm.org/bugs/show_bug.cgi?id=25409 Thanks! r? @brson
2016-02-03Auto merge of #30834 - reem:rwlock-read-guard-map, r=alexcrichtonbors-57/+228
This is very useful when the RwLock is synchronizing access to a data structure and you would like to return or store guards which contain references to data inside the data structure instead of the data structure itself.
2016-02-03Reformat commentsPaul Dicker-12/+13
2016-02-03Adress commentsPaul Dicker-29/+63
2016-02-03Auto merge of #31056 - kamalmarhubi:std-process-nul-chars, r=alexcrichtonbors-52/+163
This reports an error at the point of calling `Command::spawn()` or one of its equivalents. Fixes #30858 Fixes #30862
2016-02-03std: Properly handle interior NULs in std::processKamal Marhubi-52/+163
This reports an error at the point of calling `Command::spawn()` or one of its equivalents. Fixes https://github.com/rust-lang/rust/issues/30858 Fixes https://github.com/rust-lang/rust/issues/30862
2016-02-03Fix broken auto-mac-ios-opt buildNikita Baksalyar-27/+23
2016-02-03Auto merge of #31375 - nagisa:path-docs, r=alexcrichtonbors-29/+51
2016-02-02trying again at fixing stackp initializationDave Huseby-3/+18
2016-02-02simplifying get_stackDave Huseby-24/+3
2016-02-02refactoring get_stack to be cleanerDave Huseby-27/+20
2016-02-02unifying name_bytes now that the two blocks are the sameDave Huseby-8/+2
2016-02-02Fixes #31229Dave Huseby-10/+35
2016-02-03Auto merge of #31370 - Manishearth:rollup, r=Manishearthbors-0/+3
- Successful merges: #27499, #31220, #31329, #31332, #31347, #31351, #31352, #31366 - Failed merges:
2016-02-02Add issue number to guard map methods.Jonathan Reem-49/+78
2016-02-03Improve docs for Path::methodsSimonas Kazlauskas-29/+51
2016-02-03Rollup merge of #27499 - barosl:macro-doc-raw-str-hashes, r=nikomatsakisManish Goregaokar-0/+3
Any documentation comments that contain raw-string-looking sequences may pretty-print invalid code when expanding them, as the current logic always uses the `r"literal"` form, without appending any `#`s. This commit calculates the minimum number of `#`s required to wrap a comment correctly and appends `#`s appropriately. Fixes #27489.
2016-02-02Auto merge of #31312 - alexcrichton:no-le-in-powerpc64le, r=alexcrichtonbors-33/+11
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the `target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the `powerpc64le` target does indeed set the `target_arch` as `powerpc64le`, causing a bit of inconsistency between theset two. As these are just the same instance of one instruction set, let's use `target_endian` to switch between them and only set the `target_arch` as one value. This should cut down on the number of `#[cfg]` annotations necessary and all around be a little more ergonomic.
2016-02-02Auto merge of #30991 - rthomas:master, r=Gankrobors-1/+29
Using the test @bluss suggested in #30983
2016-02-02Ensure capacity returned of HashMap is max(capacity, length).Ryan Thomas-1/+29
r? @Gankro
2016-02-02Enable more fs tests on WindowsPaul Dicker-171/+143
2016-02-02Rollup merge of #31345 - kamalmarhubi:book-docs-special-section-errors, ↵Steve Klabnik-14/+14
r=steveklabnik This matches the usage in the standard library's documentation.
2016-02-01Remove "powerpc64le" and "mipsel" target_archAlex Crichton-33/+11
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the `target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the `powerpc64le` target does indeed set the `target_arch` as `powerpc64le`, causing a bit of inconsistency between theset two. As these are just the same instance of one instruction set, let's use `target_endian` to switch between them and only set the `target_arch` as one value. This should cut down on the number of `#[cfg]` annotations necessary and all around be a little more ergonomic.
2016-02-01docs: Standardize on 'Errors' header in std docsKamal Marhubi-14/+14
2016-02-01Add AsciiExt::into_ascii_{upper,lower}caseSimon Sapin-0/+106
The default implementations (with where Self: Sized) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`). CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950
2016-01-31Minor corrections in docs for `std::process::Child`Dirk Gadsden-4/+6
2016-01-31Safety docs about `std::process::Child` going out of scopeDirk Gadsden-0/+8
There is no `Drop` implemented for `Child`, so if it goes out of scope in Rust-land and gets deallocated, the child process will continue to exist and execute. If users want a guarantee that the process has finished running and exited they must manually use `kill`, `wait`, or `wait_with_output`. Fixes #31289.
2016-01-31Fix unresolved name in libstd/sys/unix/threadNikita Baksalyar-1/+1
2016-01-31Rename sunos to solarisNikita Baksalyar-37/+37
2016-01-31Fix problems with f64 and DirEntry on IllumosNikita Baksalyar-67/+37
2016-01-31Apply several fixes for Illumos supportNikita Baksalyar-39/+76
2016-01-31Add Illumos supportNikita Baksalyar-29/+268
2016-01-31Auto merge of #31298 - japaric:mips-musl, r=alexcrichtonbors-2/+12
This target covers MIPS devices that run the trunk version of OpenWRT. The x86_64-unknown-linux-musl target always links statically to C libraries. For the mips(el)-unknown-linux-musl target, we opt for dynamic linking (like most of other targets do) to keep binary size down. As for the C compiler flags used in the build system, we use the same flags used for the mips(el)-unknown-linux-gnu target. r? @alexcrichton
2016-01-30Change MutexGuard and RwLockWriteGuard to store &mut T not &UnsafeCell<T>Jonathan Reem-38/+46
This centralizes the unsafety of converting from UnsafeCell<T> to &mut T.
2016-01-30Rollup merge of #31292 - alexcrichton:osx-dtors-in-dtors-in-dtors, r=aturonManish Goregaokar-0/+25
This test has been deadlocking and causing problems on the bots basically since its inception. Some memory safety issues were fixed in 987dc84b, but the deadlocks remained afterwards unfortunately. After some investigation, I've concluded that this is just a situation where OSX is not guaranteed to run destructors. The fix in 987dc84b observed that OSX was rewriting the backing TLS memory to its initial state during destruction while we weren't looking, and this would have the effect of canceling the destructors of any other initialized TLS slots. While very difficult to pin down, this is basically what I assume is happening here, so there doesn't seem to really be anythig we can do to ensure the test robustly passes on OSX, so just ignore it for now.
2016-01-29Add guard map methods for transforming guards to contain sub-borrows.Jonathan Reem-5/+139
This is very useful when the lock is synchronizing access to a data structure and you would like to return or store guards which contain references to data inside the data structure instead of the data structure itself.
2016-01-30Auto merge of #30448 - alexcrichton:llvmup, r=nikomatsakisbors-114/+199
These commits perform a few high-level changes with the goal of enabling i686 MSVC unwinding: * LLVM is upgraded to pick up the new exception handling instructions and intrinsics for MSVC. This puts us somewhere along the 3.8 branch, but we should still be compatible with LLVM 3.7 for non-MSVC targets. * All unwinding for MSVC targets (both 32 and 64-bit) are implemented in terms of this new LLVM support. I would like to also extend this to Windows GNU targets to drop the runtime dependencies we have on MinGW, but I'd like to land this first. * Some tests were fixed up for i686 MSVC here and there where necessary. The full test suite should be passing now for that target. In terms of landing this I plan to have this go through first, then verify that i686 MSVC works, then I'll enable `make check` on the bots for that target instead of just `make` as-is today. Closes #25869
2016-01-29trans: Reimplement unwinding on MSVCAlex Crichton-114/+199
This commit transitions the compiler to using the new exception handling instructions in LLVM for implementing unwinding for MSVC. This affects both 32 and 64-bit MSVC as they're both now using SEH-based strategies. In terms of standard library support, lots more details about how SEH unwinding is implemented can be found in the commits. In terms of trans, this change necessitated a few modifications: * Branches were added to detect when the old landingpad instruction is used or the new cleanuppad instruction is used to `trans::cleanup`. * The return value from `cleanuppad` is not stored in an `alloca` (because it cannot be). * Each block in trans now has an `Option<LandingPad>` instead of `is_lpad: bool` for indicating whether it's in a landing pad or not. The new exception handling intrinsics require that on MSVC each `call` inside of a landing pad is annotated with which landing pad that it's in. This change to the basic block means that whenever a `call` or `invoke` instruction is generated we know whether to annotate it as part of a cleanuppad or not. * Lots of modifications were made to the instruction builders to construct the new instructions as well as pass the tagging information for the call/invoke instructions. * The translation of the `try` intrinsics for MSVC has been overhauled to use the new `catchpad` instruction. The filter function is now also a rustc-generated function instead of a purely libstd-defined function. The libstd definition still exists, it just has a stable ABI across architectures and leaves some of the really weird implementation details to the compiler (e.g. the `localescape` and `localrecover` intrinsics).
2016-01-29add support for mips(el)-unknown-linux-muslJorge Aparicio-2/+12
This target covers MIPS devices that run the trunk version of OpenWRT. The x86_64-unknown-linux-musl target always links statically to C libraries. For the mips(el)-unknown-linux-musl target, we opt for dynamic linking (like most of other targets do) to keep binary size down. As for the C compiler flags used in the build system, we use the same flags used for the mips(el)-unknown-linux-gnu target.
2016-01-29std: Ignore dtors_in_dtors_in_dtors on OSXAlex Crichton-0/+25
This test has been deadlocking and causing problems on the bots basically since its inception. Some memory safety issues were fixed in 987dc84b, but the deadlocks remained afterwards unfortunately. After some investigation, I've concluded that this is just a situation where OSX is not guaranteed to run destructors. The fix in 987dc84b observed that OSX was rewriting the backing TLS memory to its initial state during destruction while we weren't looking, and this would have the effect of canceling the destructors of any other initialized TLS slots. While very difficult to pin down, this is basically what I assume is happening here, so there doesn't seem to really be anythig we can do to ensure the test robustly passes on OSX, so just ignore it for now.
2016-01-28std: Fix rumprun buildAlex Crichton-4/+9
Looks like the rumprun build has bitrotted over time, so this includes some libc fixes and some various libstd fixes which gets it back to bootstrapping.
2016-01-28Auto merge of #31171 - dirk:dirk/safety-section-in-cstring-docs, r=steveklabnikbors-4/+16
Also a minor language tweak to the documentation of the `ffi::CString::from_raw` function.
2016-01-27Fix formatting in documentation of `ffi::CString`Dirk Gadsden-2/+2
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-110/+129
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today