about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-11-18Fix buildbot failuresVadim Petrochenkov-9/+23
2015-11-18Auto merge of #29897 - alexcrichton:process-wait-with-output, r=brsonbors-20/+14
Previously this function used channels but this isn't necessary any more now that threads have return values. This also has the added bonus of appropriately waiting for the thread to exit to ensure that the function doesn't still have running threads once it returns.
2015-11-18Add missing annotations and some testsVadim Petrochenkov-14/+188
2015-11-17std: Use join() in Process::wait_with_outputAlex Crichton-20/+14
Previously this function used channels but this isn't necessary any more now that threads have return values. This also has the added bonus of appropriately waiting for the thread to exit to ensure that the function doesn't still have running threads once it returns.
2015-11-17Rollup merge of #29880 - dignati:fix-freebsd-libc, r=alexcrichtonManish Goregaokar-11/+9
With this change the build on FreeBSD is almost working again.
2015-11-17Fix libc module name for FreeBSDOle Krüger-11/+9
2015-11-17Auto merge of #29297 - tbu-:pr_env_ignore_malformed, r=alexcrichtonbors-8/+17
Otherwise, the iterator and the functions for getting specific environment variables might disagree, for environments like FOOBAR
2015-11-16Ignore malformed environment strings like glibc doesTobias Bucher-8/+17
Otherwise, the iterator and the functions for getting specific environment variables might disagree, for environments like FOOBAR Variable names starting with equals sign are OK: glibc only interprets equals signs not in the first position as separators between variable name and variable value. Instead of skipping them entirely, a leading equals sign is interpreted to be part of the variable name.
2015-11-16Correct comment in `Mutex` exampleAndrew Paseltiner-1/+1
2015-11-16Auto merge of #29830 - petrochenkov:mapdoc, r=alexcrichtonbors-2/+3
r? @steveklabnik
2015-11-16Fix docs for HashSet::insertSebastian Hahn-4/+1
insert() returns bool, but it was wrongly stated that if the set had the key already present, that key would be returned (this was probably copied from the HashMap docs). Also remove a reference to the module-level documentation, which doesn't make sense as it doesn't give any more context.
2015-11-14docs: Clarify insertion behavior for mapsVadim Petrochenkov-2/+3
2015-11-12Fixup #29785Manish Goregaokar-1/+1
2015-11-12Rollup merge of #29785 - steveklabnik:doc_prelude, r=nikomatsakisManish Goregaokar-96/+115
This mostly brings them in line with existing linking convention, but also has some minor re-wording. The text at the top has been re-focused, by starting out with what the prelude does, rather than starting from injecting std. Also, it now mentions that other preludes exist. Part of https://github.com/rust-lang/rust/issues/29369
2015-11-11Clean up the prelude docsSteve Klabnik-96/+115
This mostly brings them in line with existing linking convention, but also has some minor re-wording. The text at the top has been re-focused, by starting out with what the prelude does, rather than starting from injecting std. Also, it now mentions that other preludes exist. Part of https://github.com/rust-lang/rust/issues/29369
2015-11-11Cleaner c_char cfg logicarcnmx-11/+10
2015-11-11Prefer raw::c_char or libc::c_char and fix armarcnmx-39/+36
2015-11-11Auto merge of #29755 - mbrubeck:stat-doc, r=steveklabnikbors-2/+4
Moved from #29753. r? @steveklabnik
2015-11-10Auto merge of #29724 - alexcrichton:ip-endian, r=aturonbors-2/+9
The comparison of IP addresses should happen not always in network endianness but rather in the host endianness format, so be sure to convert to that before comparing addresses. There are still locations where the endianness will factor into visible properties, such as the hash, but these are not important to be independent of the endianness in play (as hash values are pretty undefined anyway. Closes #29691
2015-11-10[docs] Update references to renamed fs::stat functionMatt Brubeck-2/+4
2015-11-10Rollup merge of #29708 - Ryman:pathdoc, r=steveklabnikSteve Klabnik-0/+15
r? @steveklabnik
2015-11-09std: Migrate to the new libcAlex Crichton-2339/+1755
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-11-09std: Fix endianness in Ord for IP addressesAlex Crichton-2/+9
The comparison of IP addresses should happen not always in network endianness but rather in the host endianness format, so be sure to convert to that before comparing addresses. There are still locations where the endianness will factor into visible properties, such as the hash, but these are not important to be independent of the endianness in play (as hash values are pretty undefined anyway. Closes #29691
2015-11-09libstd: add example for PathBuf::pushKevin Butler-0/+15
2015-11-08Spell out the fallback of `std::env::home_dir` on POSIXTobias Bucher-1/+3
2015-11-07Update list of array implementations in src/libstd/primitive_docs.rsOliver Middleton-1/+3
2015-11-06Auto merge of #29462 - alexcrichton:refactor-process-ret, r=aturonbors-64/+57
* Store the native representation directly in the `ExitStatus` structure instead of a "parsed version" (mostly for Unix). * On Windows, be more robust against processes exiting with the status of 259. Unfortunately this exit code corresponds to `STILL_ACTIVE`, causing libstd to think the process was still alive, causing an infinite loop. Instead the loop is removed altogether and `WaitForSingleObject` is used to wait for the process to exit.
2015-11-06std: Refactor process exit code handling slightlyAlex Crichton-64/+57
* Store the native representation directly in the `ExitStatus` structure instead of a "parsed version" (mostly for Unix). * On Windows, be more robust against processes exiting with the status of 259. Unfortunately this exit code corresponds to `STILL_ACTIVE`, causing libstd to think the process was still alive, causing an infinite loop. Instead the loop is removed altogether and `WaitForSingleObject` is used to wait for the process to exit.
2015-11-06Auto merge of #29643 - petrochenkov:stability5, r=alexcrichtonbors-5/+0
Also remove `stable` stability annotations from inherent impls (There will be a warning for useless stability annotations soon.) r? @Gankro
2015-11-06Auto merge of #29615 - steveklabnik:lol_strings, r=alexcrichtonbors-1/+1
&format!("...") is the same as "" if we're not doing any interpolation, and doesn't allocate an intermediate String.
2015-11-06Auto merge of #29604 - bstrie:de_ms, r=alexcrichtonbors-0/+5
2015-11-06Auto merge of #29491 - alexcrichton:avoid-stdio-tls, r=brsonbors-8/+26
Currently if a print happens while a thread is being torn down it may cause a panic if the LOCAL_STDOUT TLS slot has been destroyed by that point. This adds a guard to check and prints to the process stdout if that's the case (as we do for if the slot is already borrowed). Closes #29488
2015-11-06Auto merge of #29305 - alexcrichton:bad-getenv, r=brsonbors-56/+62
As discovered in #29298, `env::set_var("", "")` will panic, but it turns out that it *also* deadlocks on Unix systems. This happens because if a panic happens while holding the environment lock, we then go try to read RUST_BACKTRACE, grabbing the environment lock, causing a deadlock. Specifically, the changes made here are: * The environment lock is pushed into `std::sys` instead of `std::env`. This also only puts it in the Unix implementation, not Windows where the functions are already threadsafe. * The `std::sys` implementation now returns `io::Result` so panics are explicitly at the `std::env` level.
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-5/+0
Remove `stable` stability annotations from inherent impls
2015-11-06doc(lib.rs): fix #L79 with inline link syntaxRizky Luthfianto-2/+1
2015-11-05remove excess string allocationSteve Klabnik-1/+1
&format!("...") is the same as "" if we're not doing any interpolation, and doesn't allocate an intermediate String.
2015-11-05Rollup merge of #29568 - steveklabnik:gh24591, r=apasel422Steve Klabnik-0/+3
Fixes #24591
2015-11-04Deprecate `_ms` functions that predate the `Duration` APIBen Striegel-0/+5
2015-11-04Auto merge of #29200 - tshepang:rustfmt-path, r=aturonbors-96/+165
2015-11-04Add note about HashMap::capacity's boundsSteve Klabnik-0/+3
Fixes #24591
2015-11-03libstd: implement PartialEq<Path> for PathBuf and Cow<Path>Kevin Butler-0/+48
2015-11-03libstd: implement From<&Path|PathBuf> for Cow<Path>Kevin Butler-0/+36
2015-11-03Auto merge of #29514 - apasel422:issue-26220, r=alexcrichtonbors-0/+14
Closes #26220. r? @alexcrichton
2015-11-02Auto merge of #29456 - alexcrichton:path-hash, r=aturonbors-3/+37
Almost all operations on Path are based on the components iterator in one form or another to handle equivalent paths. The `Hash` implementations, however, mistakenly just went straight to the underlying `OsStr`, causing these equivalent paths to not get merged together. This commit updates the `Hash` implementation to also be based on the iterator which should ensure that if two paths are equal they hash to the same thing. cc #29008, but doesn't close it
2015-11-02std: Base Hash for Path on its iteratorAlex Crichton-3/+37
Almost all operations on Path are based on the components iterator in one form or another to handle equivalent paths. The `Hash` implementations, however, mistakenly just went straight to the underlying `OsStr`, causing these equivalent paths to not get merged together. This commit updates the `Hash` implementation to also be based on the iterator which should ensure that if two paths are equal they hash to the same thing. cc #29008, but doesn't close it
2015-11-02Auto merge of #29510 - mneumann:dragonfly-guard-page, r=alexcrichtonbors-0/+4
Only tested on DragonFly.
2015-11-01Implement `IntoIterator` for `&{Path, PathBuf}`Andrew Paseltiner-0/+14
Closes #26220.
2015-11-01Use guard-pages also on DragonFly/FreeBSD.Michael Neumann-0/+4
Only tested on DragonFly.
2015-11-01Auto merge of #29177 - vadimcn:rtstuff, r=alexcrichtonbors-55/+87
Note: for now, this change only affects `-windows-gnu` builds. So why was this `libgcc` dylib dependency needed in the first place? The stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process. The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process. All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output). Another important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process. This pretty much means that the unwinder must be in a shared library (unless everything is statically linked). Now, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once. So if we link the unwinder statically to one of Rust's crates, everything should be fine. Unfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them. So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`! A side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.
2015-10-31Fix stage0 ICE caused by the old _Unwind_Resume override trickery.Vadim Chugunov-0/+2