about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2017-09-17Rollup merge of #44622 - frewsxcv:frewsxcv-invalid-link, r=QuietMisdreavusTim Neumann-1/+1
Fix incorrect `into_inner` link in docs. Fixes https://github.com/rust-lang/rust/issues/42373.
2017-09-17std: Document thread builder panics for nul bytes in thread namesUlrik Sverdrup-0/+7
This seems to have been undocumented. Mention this where the name is set (Builder::name) and where the panic could happen (Builder::spawn). Thread::new is private and I think the builder is the only user where this matters. A short comment was added to "document" Thread::new too.
2017-09-17Ensure tcp test case passes when disconnected from networkTrevor Merrifield-2/+5
net::tcp::tests::connect_timeout_unroutable fails when the network is unreachable, like on a laptop disconnected from wifi. Check for this error and allow the test to pass. Closes #44645
2017-09-16Fix network familiesJeremy Soller-2/+2
2017-09-16Rollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnikAlex Crichton-0/+6
Mention that HashMap::new and HashSet::new do not allocate The docs for `HashMap::with_capacity` and `HashSet::with_capacity` already say that > If `capacity` is 0, the hash map/set will not allocate. However, the docs for `::new` do not say that the initial capacity is 0, and thus promise that a call to `::new` alone does not allocate. This PR fixes that.
2017-09-16Rollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichtonAlex Crichton-1/+89
Ipv4Addr and Ipv6Addr convenience constructors. Introduce convenience constructors for common types. This introduces the following constructors: * Ipv6Addr::localhost() * Ipv6Addr::unspecified() * Ipv4Addr::localhost() * Ipv4Addr::unspecified() The recently added `From` implementations were nice for avoiding the fallibility of conversions from strings like `"127.0.0.1".parse().unwrap()`, and `"::1".parse().unwrap()`, but while the Ipv4 version is roughly comparable in verbosity, the Ipv6 version lacks zero-segment elision, which makes it significantly more awkward: `[0, 0, 0, 0, 0, 0, 0, 0].into()`. While there isn't a clear way to introduce zero elision to type that can infallibly be converted into Ipv6 addresses, this PR resolves the problem for the two most commonly used addresses, which, incidentally, are the ones that suffer the most from the lack of zero-segment elision. This change is dead simple, and introduces no backwards incompatibility. See also, [this topic on the inernals board](https://internals.rust-lang.org/t/pre-rfc-convenience-ip-address-constructors/5878)
2017-09-16stabilized needs_drop (fixes #41890)Michal Budzynski-1/+0
2017-09-16Auto merge of #43017 - durka:stabilize-const-invocation, r=eddybbors-0/+13
Individualize feature gates for const fn invocation This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward. This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review. - `std::cell` - `Cell::new` - `RefCell::new` - `UnsafeCell::new` - `std::mem` - `size_of` - `align_of` - `std::ptr` - `null` - `null_mut` - `std::sync` - `atomic` - `Atomic{Bool,Ptr,Isize,Usize}::new` - `once` - `Once::new` - primitives - `{integer}::min_value` - `{integer}::max_value` Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time. After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR. - `std::sync` - `atomic` - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT` - `once` - `ONCE_INIT`
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-0/+13
2017-09-15Expand some of the std{in,out,err} usages.Corey Farwell-8/+14
2017-09-15Indicate how ChildStd{in,out,err} FDs are closed.Corey Farwell-0/+12
Fixes https://github.com/rust-lang/rust/issues/41452.
2017-09-15Retain suid/sgid/sticky bits in Metadata.permissionsTrevor Merrifield-3/+3
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-15Fix incorrect `into_inner` link in docs.Corey Farwell-1/+1
Fixes https://github.com/rust-lang/rust/issues/42373.
2017-09-15HashMap::new and HashSet::new do not allocateJon Gjengset-0/+6
2017-09-14Rollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, ↵Corey Farwell-1/+1
r=alexcrichton stabilize tcpstream_connect_timeout (closes #43079)
2017-09-14Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisdreavusCorey Farwell-5/+23
Openoptions docs r? @QuietMisdreavus
2017-09-14Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcvCorey Farwell-16/+9
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv #22569 #44209
2017-09-14Rollup merge of #44378 - frehberg:rustdoc, r=dtolnayCorey Farwell-13/+41
rustdoc: extend UdpSocket API doc (#657) see https://github.com/carllerche/mio/issues/657
2017-09-14Add unstable attributes for Ipv?Addr constructors.J. Cliff Dyer-5/+17
2017-09-14stabilize tcpstream_connect_timeout (closes #43079)Michal Budzynski-1/+1
2017-09-14Merge branch 'master' into threadnameJoshua Sheard-109/+690
2017-09-14Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichtonbors-46/+537
Add the libstd-modifications needed for the L4Re target This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re). A target for the L4Re was introduced in commit: c151220a84e40b65e45308cc0f3bbea4466d3acf In many aspects implementations for linux also apply for the L4Re microkernel. Some uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads * L4Re has no uid or gid Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-13Add note for append method in OpenOptions docsGuillaume Gomez-0/+6
2017-09-13Add missing urls for OpenOptions docsGuillaume Gomez-5/+17
2017-09-13from_micros: add feature nameRomain Porte-1/+2
2017-09-13Move default stack min size to thread implementationsTobias Schaffner-25/+31
The default min stack size value is smaller on l4re and therefore this value has to be different depending on the platform.
2017-09-12Correctly bubble up errors from libbacktraceAidan Hobson Sayers-15/+23
2017-09-12Addressed @BurntSuchi's remarks regarding Entry::replaceJeroen Bollen-4/+3
2017-09-12Auto merge of #44344 - jonhoo:entry_or_default, r=BurntSushibors-0/+27
Add or_default to Entry APIs As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
2017-09-11Fix tidy checksJeremy Soller-18/+44
2017-09-11Sync with upstream syscall libraryJeremy Soller-12/+146
2017-09-12rustdoc: extend UdpSocket API doc (#657)Frank Rehberger-13/+41
rustdoc: type-fixes
2017-09-10Auto merge of #44220 - ↵bors-21/+43
kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton Properly detect overflow in Instance ± Duration. Fix #44216. Fix #42622 The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic. The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second. Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.
2017-09-10Add Cow<str> -> Box<Error> impls.Clar Charr-0/+15
2017-09-10from_micros: added issue number and fixed typoRomain Porte-2/+2
2017-09-10Auto merge of #44474 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-1/+6
Rollup of 13 pull requests - Successful merges: #44262, #44329, #44332, #44347, #44372, #44384, #44387, #44396, #44449, #44451, #44457, #44464, #44467 - Failed merges:
2017-09-10Rollup merge of #44396 - joshlf:tls-comment, r=alexcrichtonGuillaume Gomez-0/+4
std::thread::LocalKey: Document limitation with initializers Document that if a `LocalKey`'s initializer recursively depends on itself, initialization will result in infinite recursion.
2017-09-10Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebankGuillaume Gomez-1/+2
std: Fix a segfault on OSX with backtraces Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-10Use rvalue promotion to 'static instead of static items.Eduard-Mihai Burtescu-16/+4
2017-09-10from_micros: Fix missing {Romain Porte-0/+1
2017-09-09Auto merge of #44251 - kennytm:osx-backtrace, r=alexcrichtonbors-21/+48
Add libbacktrace support for Apple platforms (resubmitted) Resubmitting #43422 rebased on the current master (cc @JohnColanduoni). I have added an additional commit to fallback to `dladdr`-based `resolve_symbol` if `libbacktrace` returns `None`, otherwise the stack trace will be full of `<unknown>` when you forget to pass the `-g` flag (actually it seems — at least on macOS — the `dladdr` symbol is more accurate than the `libbacktrace` one).
2017-09-09from_micros: Added unstable annotationRomain Porte-0/+1
2017-09-09from_micros: Inlined return for consistencyRomain Porte-4/+1
2017-09-09Auto merge of #44438 - Xaeroxe:clamp, r=Mark-Simulacrumbors-89/+0
Revert clamp Revert clamp per https://github.com/rust-lang/rust/issues/44095#issuecomment-328218316 while we take time to assess the potential backwards compatibility damage done by it.
2017-09-08Add feature gate to doctests.J. Cliff Dyer-0/+4
2017-09-08Revert "Add clamp functions"Jacob Kiesel-40/+0
This reverts commit c589f867f89d4e6e48c6602aed8e878208d4822f.
2017-09-08Revert "Add NAN examples"Jacob Kiesel-2/+0
This reverts commit f74c5d2e18e50c24de2cc1192bf2088cdaa61916.
2017-09-08Revert "Fix f32 examples."Jacob Kiesel-4/+2
This reverts commit 61f20f8df02e53ee60dc1719ce0e502eecebf8b4.
2017-09-08Revert "Fix f64 examples"Jacob Kiesel-4/+2
This reverts commit 576426a05a1a6cb33eece7082d7341b7c6bb5277.
2017-09-08Revert "Fix documentation and formatting."Jacob Kiesel-8/+2
This reverts commit 2e34ff767113c6a15c5862b0646ca9ad7ffd81b1.