about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
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
2015-10-31std: Prevent print panics when using TLSAlex Crichton-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-10-31Auto merge of #29487 - sfackler:current-exe-docs, r=steveklabnikbors-3/+3
The "optionally" stuff just makes things confusing. r? @steveklabnik
2015-10-30Tweak env docs a bitSteven Fackler-3/+3
The "optionally" stuff just makes things confusing.
2015-10-31Auto merge of #29484 - steveklabnik:gh29330, r=brsonbors-130/+145
These two commits do a few things: 1. reformat to 80 cols 2. use the reference-style links where appropriate for improved in-source readability 3. adds a few links, tweaks a couple of words, `3` -> `three`, stuff like that While the diff is big due to these edits, there's no significant content change. r? @brson
2015-10-30Some fixes to std index docsSteve Klabnik-9/+10
Part of https://github.com/rust-lang/rust/issues/29330 Needed because of https://github.com/rust-lang/rust/issues/29481 and https://github.com/rust-lang/rust/issues/29483
2015-10-30Clean up formatting on std main pageSteve Klabnik-130/+144
Part of #29330
2015-10-30don't use drop_in_place as an intrinsicAlexis Beingessner-1/+3
2015-10-30run rustfmt on std::pathTshepang Lekhonkhobe-96/+165
There was a bunch of manual fixes too... rustfmt isn't quite there yet
2015-10-29Auto merge of #29289 - DiamondLovesYou:pnacl-std-crates, r=alexcrichtonbors-299/+267
2015-10-28Port the standard crates to PNaCl/NaCl.Richard Diamond-299/+267
2015-10-27Auto merge of #29298 - tbu-:pr_doc_env_panic, r=alexcrichtonbors-0/+12
2015-10-26std: Slightly more robust env var handlingAlex Crichton-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. The panic messages have also been improved in these situations.