about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-10-04Auto merge of #44890 - nvzqz:str-box-transmute, r=alexcrichtonbors-23/+28
Remove mem::transmute used in Box<str> conversions Given that https://github.com/rust-lang/rust/pull/44877 is failing, I decided to make a separate PR. This is done with the same motivation: to avoid `mem::transmute`-ing non `#[repr(C)]` types.
2017-10-04Auto merge of #44905 - Pirh:process_abort_docs, r=steveklabnikbors-2/+13
Update docs for process::abort Remove a typo and explain the relationship to `panic!`. Part of #29370 r? @steveklabnik
2017-10-04Auto merge of #44979 - hinaria:master, r=dtolnaybors-0/+13
make `backtrace = false` compile for windows targets. when building for windows with `backtrace = false`, `libstd` fails to compile because some modules that use items from `sys_common::backtrace::*` are still included, even though those modules aren't used or referenced by anything. `sys_common::backtrace` doesn't exist when the backtrace feature is turned off. -- i've also added `#[cfg(feature = "backtrace")]` to various items that exist exclusively to support `mod backtrace` since the compilation would fail since they would be unused in a configuration with backtraces turned off.
2017-10-03Auto merge of #44895 - stephaneyfx:master, r=dtolnaybors-7/+22
Made `fs::copy` return the length of the main stream On Windows with the NTFS filesystem, `fs::copy` would return the sum of the lengths of all streams, which can be different from the length reported by `metadata` and thus confusing for users unaware of this NTFS peculiarity. This makes `fs::copy` return the same length `metadata` reports which is the value it used to return before PR #26751. Note that alternate streams are still copied; their length is just not included in the returned value. This change relies on the assumption that the stream with index 1 is always the main stream in the `CopyFileEx` callback. I could not find any official document confirming this but empirical testing has shown this to be true, regardless of whether the alternate stream is created before or after the main stream. Resolves #44532
2017-10-02Document that process::abort will not call the panic hookPirh-1/+3
2017-10-03windows: make `backtrace = false` compilehinaria-0/+13
2017-09-30Cast inner type in OsStr::bytesNikolai Vazquez-1/+1
The innermost type is not [u8] on all platforms but is assumed to have the same memory layout as [u8] since this conversion was done via mem::transmute before.
2017-09-30Auto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-3/+67
Rollup of 15 pull requests - Successful merges: #44124, #44287, #44320, #44694, #44708, #44794, #44797, #44824, #44836, #44840, #44845, #44854, #44889, #44900, #44903 - Failed merges:
2017-09-29Rollup merge of #44824 - dtolnay:22really21, r=alexcrichtonMark Simulacrum-1/+1
Backport libs stabilizations to 1.21 beta Includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640 These have been backported in https://github.com/rust-lang/rust/pull/44823.
2017-09-29Rollup merge of #44797 - lucasem:master, r=frewsxcvMark Simulacrum-2/+55
docs improvement std::sync::{PoisonError, TryLockError} Addresses the `PoisonError` and `TryLockError` parts of #29377. Adds examples and links. r? @steveklabnik
2017-09-29Rollup merge of #44794 - napen123:master, r=frewsxcvMark Simulacrum-0/+11
Add doc example to HashMap::hasher None
2017-09-29Auto merge of #44174 - jimmycuadra:try-from-infallible, r=sfacklerbors-0/+8
Add blanket TryFrom impl when From is implemented. Adds `impl<T, U> TryFrom<T> for U where U: From<T>`. Removes `impl<'a, T> TryFrom<&'a str> for T where T: FromStr` (originally added in #40281) due to overlapping impls caused by the new blanket impl. This removal is to be discussed further on the tracking issue for TryFrom. Refs #33417. /cc @sfackler, @scottmcm (thank you for the help!), and @aturon
2017-09-28Auto merge of #44278 - Binero:master, r=BurntSushibors-0/+30
Allow replacing HashMap entries This is an obvious API hole. At the moment the only way to retrieve an entry from a `HashMap` is to get an entry to it, remove it, and then insert a new entry. This PR allows entries to be replaced.
2017-09-28Fix errors in Box<Path> conversionsNikolai Vazquez-2/+4
2017-09-28Update to the `cc` crateAlex Crichton-3/+3
This is the name the `gcc` crate has moved to
2017-09-28Remove unused 'mem' import in 'path' moduleNikolai Vazquez-1/+0
2017-09-28Remove mem::transmute used in Path conversionsNikolai Vazquez-8/+9
2017-09-28Remove unused 'mem' import in 'os_str' moduleNikolai Vazquez-1/+0
2017-09-28Remove mem::transmute used in OsStr conversionsNikolai Vazquez-7/+10
2017-09-28Fix mutability error in CString::from_rawNikolai Vazquez-1/+1
2017-09-28Remove mem::transmute used in CStr conversionsNikolai Vazquez-7/+8
2017-09-27Made `fs::copy` return the length of the main streamStephane Raux-7/+22
On Windows with the NTFS filesystem, `fs::copy` would return the sum of the lengths of all streams, which can be different from the length reported by `metadata` and thus confusing for users unaware of this NTFS peculiarity. This makes `fs::copy` return the same length `metadata` reports which is the value it used to return before PR #26751. Note that alternate streams are still copied; their length is just not included in the returned value. This change relies on the assumption that the stream with index 1 is always the main stream in the `CopyFileEx` callback. I could not find any official document confirming this but empirical testing has shown this to be true, regardless of whether the alternate stream is created before or after the main stream. Resolves #44532
2017-09-27Explain difference between panic! and abort in abort docsPirh-1/+10
As per #29370
2017-09-27Remove extraneous brackets from abort documentationPirh-1/+1
As per #29370
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-1/+1
This includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-24LP_CLONE_FDIO_ROOT is now LP_CLONE_FDIO_NAMESPACEJames Tucker-2/+2
2017-09-24Fixed casing issues.P.Y. Laligand-16/+16
2017-09-24The Magenta kernel is now called Zircon.P.Y. Laligand-136/+136
2017-09-24Add doc example to HashMap::hasherEthan Dagner-0/+11
2017-09-24Rollup merge of #44625 - frewsxcv:frewsxcv-raii-stdin, r=QuietMisdreavusGuillaume Gomez-8/+24
Indicate how ChildStd{in,out,err} FDs are closed. Fixes https://github.com/rust-lang/rust/issues/41452.
2017-09-23Simplify implementation of Display and Error for convert::Infallible.Jimmy Cuadra-1/+2
2017-09-23docs improvement std::sync::{PoisonError, TryLockError}Lucas Morales-2/+55
2017-09-23Auto merge of #44436 - MicroJoe:master, r=alexcrichtonbors-0/+23
Add Duration::from_micros This fixes #44400 that explains why it could be useful for embedded designs timing.
2017-09-23Rollup merge of #44778 - lucasem:master, r=estebankCorey Farwell-13/+120
std::sync::RwLock docs improvement Addresses the `RwLock` part of #29377. r? @steveklabnik Added examples, links to types, and a small comparison between RwLock and Mutex.
2017-09-23Rollup merge of #44759 - durka:patch-43, r=steveklabnikCorey Farwell-3/+3
improve english in create_dir_all docs Just minor nitpicking.
2017-09-23Rollup merge of #44712 - oconnor663:copy_test, r=GuillaumeGomezCorey Farwell-1/+2
fix an incorrect assertion in the doc example for `std::io::copy` I think this wasn't caught by CI because the `foo` wrapper function was only defined and not called. This seems to be the norm for doc examples that define a `foo` function. Is that on purpose?
2017-09-23Rollup merge of #44648 - Havvy:doc-size_of, r=dtolnayCorey Farwell-0/+8
Expand size_of docs This PR does 3 things. 1. Adds a description of what pointer size means to the primitive pages for usize and isize. 2. Says the general size of things is not stable from compiler to compiler. 3. Adds a table of sizes of things that we do guarantee. As this is the first table in the libstd docs, I've included a picture of how that looks. ![](https://i.imgur.com/YZ6IChH.png?1)
2017-09-22std::sync::RwLock docs improvementLucas Morales-13/+120
2017-09-22Auto merge of #44624 - tmerr:master, r=sfacklerbors-3/+24
Retain suid/sgid/sticky bits in Metadata.permissions Most users would expect set_permissions(Metadata.permissions()) to be non-destructive. While we can't guarantee this, we can at least pass the needed info to chmod. Also update the PermissionsExt documentation to disambiguate what it contains, and to refer to the underlying value as `st_mode` rather than its type `mode_t`. Closes #44147
2017-09-21impl std::error::Error for convert::Infallible.Jimmy Cuadra-0/+7
2017-09-21Add note about being blocked on input.Corey Farwell-1/+2
2017-09-21Remove platform-specific terminology.Corey Farwell-6/+3
2017-09-21improve english in create_dir_all docsAlex Burka-3/+3
2017-09-20Document stable size_of primitives and pointer size guaranteesHavvy-0/+8
2017-09-20Auto merge of #44525 - aidanhs:aphs-no-null-deref, r=alexcrichtonbors-15/+23
Correctly bubble up errors from libbacktrace Previously the first part of this code didn't check for a null pointer and blindly passed it back down, causing a segfault if libbacktrace failed to initialise. I've changed this to check and bubble up the error if relevant. Suggested diff view: https://github.com/rust-lang/rust/pull/44525/files?w=1
2017-09-20fix an incorrect assertion in the doc example for `std::io::copy`Jack O'Connor-1/+2
2017-09-19Rollup merge of #44703 - GuillaumeGomez:missing-io-links, r=QuietMisdreavusGuillaume Gomez-4/+6
Add some missing links in io docs r? @rust-lang/docs
2017-09-19Rollup merge of #44513 - redox-os:master, r=alexcrichtonGuillaume Gomez-26/+186
[Redox] Sync with upstream syscall library This syncs the vendored syscalls with their upstream versions.
2017-09-19Add some missing links in io docsGuillaume Gomez-4/+6
2017-09-19Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnikbors-1/+7
hide internal types/traits from std docs via new #[doc(masked)] attribute Fixes #43701 (hopefully for good this time) This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs. Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter. To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.