about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-08-29API docs: macros. Part of #29329 Standard Library Documentation Checklist.Andy Gauge-21/+101
2017-08-28Update the libc submoduleAlex Crichton-12/+29
Brings in a few fixes for wasm/asmjs
2017-08-28Rewrite `std::net::ToSocketAddrs` doc examples.Corey Farwell-22/+66
in particular: * show how to create an iterator that yields multiple socket addresses * show more failing scenarios
2017-08-27Whitelist unwind import in stdTatsuyuki Ishi-2/+2
This is a part of libbacktrace linkage and thus the compiler cannot detect if it's used or not.
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-3/+3
2017-08-27Auto merge of #44112 - alexcrichton:thread-join, r=sfacklerbors-2/+13
std: Handle OS errors when joining threads Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
2017-08-26std: Handle OS errors when joining threadsAlex Crichton-2/+13
Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
2017-08-26Fix f64 examplesJacob Kiesel-2/+4
2017-08-26Fix f32 examples.Jacob Kiesel-2/+4
2017-08-26Add NAN examplesJacob Kiesel-0/+2
2017-08-26Add clamp functionsJacob Kiesel-0/+40
2017-08-26Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnikCorey Farwell-7/+7
Fix inconsistent doc headings This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574. r? @steveklabnik
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-3/+0
Fixes #41701.
2017-08-24Fix inconsistent doc headingslukaramu-7/+7
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
2017-08-23Rollup merge of #44054 - frewsxcv:frewsxcv-libstd-thread-unwrap-or-else, ↵Corey Farwell-1/+1
r=sfackler Thread spawning: don't run `min_stack` if the user has specified stack size. None
2017-08-23Rollup merge of #44039 - remexre:master, r=steveklabnikCorey Farwell-3/+5
Mention null_mut on the pointer primitive docs. Also adds a few mentions that both `*const` and `*mut` support functions, when only `*const` was mentioned before.
2017-08-23Rollup merge of #43983 - ids1024:redox-path-prefix, r=alexcrichtonCorey Farwell-3/+13
Redox: correct is_absolute() and has_root() This is awkward, but representing schemes properly in `Components` is not easily possible without breaking backwards compatibility, as discussed earlier in https://github.com/rust-lang/rust/pull/37702. But these methods can be corrected anyway.
2017-08-23Rollup merge of #43631 - ruuda:update-docs, r=QuietMisdreavusCorey Farwell-2/+2
Point "deref coercions" links to new book Currently the link on doc.rust-lang.org is semi-broken; it links to a page that links to the exact page in the first edition in the book, or to the index of the second edition of the book. If the second editions is the recommended one now, we should point the links at that one. (In the mean time, the links have been updated to point directly to the first edition of the book, but that hasn't made it onto the stable channel yet.) By the time this commit makes it onto the stable channel, the second edition of the book should be complete enough. At least the part about deref coercions is. r? @steveklabnik
2017-08-23Auto merge of #40113 - smaeul:native-musl, r=alexcrichtonbors-1/+1
Support dynamically-linked and/or native musl targets These changes allow native compilation on musl-based distributions and the use of dynamic libraries on linux-musl targets. This is intended to remove limitations based on past assumptions about musl targets, while maintaining existing behavior by default. A minor related bugfix is included.
2017-08-23Auto merge of #43830 - alexcrichton:path-display-regression, r=aturonbors-3/+13
std: Respect formatting flags for str-like OsStr Historically many `Display` and `Debug` implementations for `OsStr`-like abstractions have gone through `String::from_utf8_lossy`, but this was updated in #42613 to use an internal `Utf8Lossy` abstraction instead. This had the unfortunate side effect of causing a regression (#43765) in code which relied on these `fmt` trait implementations respecting the various formatting flags specified. This commit opportunistically adds back interpretation of formatting trait flags in the "common case" where where `OsStr`-like "thing" is all valid utf-8 and can delegate to the formatting implementation for `str`. This doesn't entirely solve the regression as non-utf8 paths will format differently than they did before still (in that they will not respect formatting flags), but this should solve the regression for all "real world" use cases of paths and such. The door's also still open for handling these flags in the future! Closes #43765
2017-08-22Thread spawning: don't run `min_stack` if the user has specified stack size.Corey Farwell-1/+1
2017-08-22Remove incorrect special case of mips-muslSamuel Holland-1/+1
The libdl/librt/libpthread provided by musl are no-op (empty static libraries) on all architectures, mips included.
2017-08-22Simplify code for handling Redox pathsIan Douglas Scott-10/+5
2017-08-22Mention null_mut on the pointer primitive docs.Nathaniel Ringo-3/+5
Also adds a few mentions that both `*const` and `*mut` support functions, when only `*const` was mentioned before.
2017-08-22Use cfg! instead of #[cfg]Ian Douglas Scott-13/+3
2017-08-21Add missing links for Read traitGuillaume Gomez-41/+65
2017-08-20redox: Correct error on exec when file is not foundIan Douglas Scott-1/+1
`.raw_os_error()` (called in `spawn()`) returned None, so this produced an incorrect error.
2017-08-19Auto merge of #43919 - frewsxcv:frewsxcv-char-primitive, r=QuietMisdreavusbors-13/+18
Minor rewrite of char primitive unicode intro. Opened primarily to address #36998. Despite my love for emoji, the heart example is a little confusing because both heart characters start with the same code point and there can be stark rendering differences across browsers. I also spelled out what each of the code points is in the code block, which (hopefully) sheds light why one character is one code point while the other is two. Very much open to suggestion and improvements. I'm pretty tired when I wrote this so I might wake up and realize that this is making things more confusing 😅
2017-08-18Correct has_root() on RedoxIan Douglas Scott-3/+20
2017-08-18redox: Require scheme for path to be absoluteIan Douglas Scott-2/+10
Redox paths are problematic. It would make sense to add a `Scheme` variant to the `std::path::Component` enum; but that would presumably be a breaking change due to exhaustive matching. Alternately it could use the existing `Prefix` variant, like Windows, but none of the existing types of prefix make sense, Redox only has one kind, and adding a new variant to that enum has the same issue as `Component`.
2017-08-18Auto merge of #43900 - TobiasSchaffner:net_out_of_io, r=alexcrichtonbors-59/+62
Refactoring: move net specific file descriptor methods Move the implementations of net specific file descriptor methods from io to net. This makes it easier to exclude net at all if it is not needed for a target.
2017-08-17Rollup merge of #43915 - adrian5:patch-1, r=sfacklerCorey Farwell-1/+1
Fix typo in doc
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-7/+7
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-17Minor rewrite of char primitive unicode intro.Corey Farwell-13/+18
Opened primarily to address #36998.
2017-08-17Fix typo in docadrian5-1/+1
2017-08-16Refactoring: move net specific fd imps to netTobias Schaffner-59/+62
Move the implementations of net specific file descriptior implementations to net. This makes it easier to exclude net at all if not needed for a target.
2017-08-16Auto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, ↵bors-3/+13
r=QuietMisdreavus Clarify writable behavior of readonly-named `Permissions` methods. Opened primarily to fix https://github.com/rust-lang/rust/issues/41984.
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-60/+60
r=Mark-Simulacrum use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
2017-08-15Clarify 'writable'-changing behavior of `set_readonly`.Corey Farwell-1/+5
Fixes https://github.com/rust-lang/rust/issues/41984.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-60/+60
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-7/+7
2017-08-15Auto merge of #43635 - ids1024:backtrace-redox, r=alexcrichtonbors-33/+160
Make backtraces work on Redox, copying Unix implementation The `backtrace/` directory here is the same as the Unix one, except for adding an implementation of `get_executable_filename`.
2017-08-15Clarify `readonly` method is also about being 'unwritable'.Corey Farwell-1/+1
2017-08-15Add comments clarifying behavior of unix `set_readonly` behavior.Corey Farwell-1/+7
2017-08-14Rollup merge of #43848 - frewsxcv:frewsxcv-stack-size, r=QuietMisdreavusCorey Farwell-10/+45
Rewrite/reorganize docs for stack size/thread names for spawned threads. * Moves docs about stack size and thread naming from `Builder` to the `std::thread` module * Adds more links to the new module-level documentation * Mentions the 2 MiB stack size default, but indicate it's subject to change Fixes https://github.com/rust-lang/rust/issues/43805.
2017-08-14Rollup merge of #43756 - sfackler:instant-nondecreasing, r=alexcrichtonCorey Farwell-2/+2
Instant is monotonically nondecreasing We don't want to guarantee that `Instant::now() != Instant::now()` is always true since that depends on the speed of the processor and the resolution of the clock.
2017-08-14Indicate which stack size option has precedence.Corey Farwell-1/+1
2017-08-13std: Respect formatting flags for str-like OsStrAlex Crichton-3/+13
Historically many `Display` and `Debug` implementations for `OsStr`-like abstractions have gone through `String::from_utf8_lossy`, but this was updated in #42613 to use an internal `Utf8Lossy` abstraction instead. This had the unfortunate side effect of causing a regression (#43765) in code which relied on these `fmt` trait implementations respecting the various formatting flags specified. This commit opportunistically adds back interpretation of formatting trait flags in the "common case" where where `OsStr`-like "thing" is all valid utf-8 and can delegate to the formatting implementation for `str`. This doesn't entirely solve the regression as non-utf8 paths will format differently than they did before still (in that they will not respect formatting flags), but this should solve the regression for all "real world" use cases of paths and such. The door's also still open for handling these flags in the future! Closes #43765
2017-08-13Indicate thread names get passed to the OS.Corey Farwell-4/+8
2017-08-13Rewrite docs for stack size/thread names for spawned threads.Corey Farwell-10/+41
* Moves docs about stack size and thread naming from `Builder` to the `std::thread` module * Adds more links to the new module-level documentation * Mentions the 2 MiB stack size default, but indicate it's subject to change Fixes https://github.com/rust-lang/rust/issues/43805.