about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2020-05-25Auto merge of #72472 - LeSeulArtichaut:sync-command, r=dtolnaybors-7/+11
Implement `Sync` for `process::Command on unix and vxworks Closes #72387. r? @cuviper
2020-05-24Fix testsHoe Hao Cheng-2/+2
2020-05-24Remove heterogeneous ordering for SocketAddrHoe Hao Cheng-55/+15
2020-05-24Fix typo in doc comment.Eitan Mosenkis-1/+1
call_one_force -> call_once_force
2020-05-24Fix asinh of negative valuesBenjamin Saunders-2/+6
When `x` has large magnitude, `x + ((x * x) + 1.0).sqrt()` approaches `x + x.abs()`. For negative values of `x`, this leads to catastrophic cancellation, resulting in large errors or even 0 being passed to `ln`, producing incorrect results including `-inf`. Becuase asinh is an odd function, i.e. -asinh(x) = asinh(-x) for all x, we can avoid the catastrophic cancellation and obtain correct results by taking the absolute value of `self` for the first term. `self * self` is always positive, so in effect this gives us `x.abs().asinh().copysign(x)` which as discussed above is algebraically equivalent, but is much more accurate.
2020-05-23Correct small typo: 'not' -> 'note'Jake Goulding-2/+2
2020-05-22Rollup merge of #72459 - yoshuawuyts:into-future, r=nikomatsakisDylan DPC-1/+16
Add core::future::IntoFuture This patch reintroduces the `core::future::IntoFuture` trait. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering since that lead to performance regressions. By introducing the trait separately from the integration, the integration PR can be more narrowly scoped, and people can start trying out the `IntoFuture` trait today. Thanks heaps! cc/ @rust-lang/wg-async-foundations ## References - Original PR adding `IntoFuture` https://github.com/rust-lang/rust/pull/65244 - Open issue to re-land `IntoFuture` (assigned to me) https://github.com/rust-lang/rust/issues/67982 - Tracking issue for `IntoFuture` https://github.com/rust-lang/rust/issues/67644
2020-05-22Implement `Sync` for `process::Command on unix and vxworksLeSeulArtichaut-7/+11
2020-05-22Rollup merge of #72399 - Lucretiel:ipv4-display-fast, r=kennytmRalf Jung-9/+16
Add fast-path optimization for Ipv4Addr::fmt Don't use an intermediary buffer when writing an IPv4 address without any specific alignment options
2020-05-22Rollup merge of #72123 - jsgf:stabilize-arg0, r=sfacklerRalf Jung-2/+2
Stabilize process_set_argv0 feature for Unix This stabilizes process_set_argv0 targeting 1.45.0. It has been useful in practice and seems useful as-is. The equivalent feature could be implemented for Windows, but as far as I know nobody has. That can be done separately. Tracking issue: #66510
2020-05-22Add core::future::IntoFutureYoshua Wuyts-1/+16
This patch adds `core::future::IntoFuture`. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering. That integration should be done in a follow-up PR.
2020-05-21Enable ARM TME (Transactional Memory Extensions)Mahmut Bulut-0/+1
2020-05-20Various minor improvements to Ipv6Addr::DisplayNathan West-80/+78
- Defer to Ipv4Addr::fmt when printing an Ipv4 address - Fast path: write directly to f without an intermediary buffer when there are no alignment options - Simplify finding the inner zeroes-span
2020-05-20Add fast-path optimization for Ipv4Addr::fmtNathan West-9/+16
2020-05-19Auto merge of #71447 - cuviper:unsized_cow, r=dtolnaybors-0/+33
impl From<Cow> for Box, Rc, and Arc These forward `Borrowed`/`Owned` values to existing `From` impls. - `Box<T>` is a fundamental type, so it would be a breaking change to add a blanket impl. Therefore, `From<Cow>` is only implemented for `[T]`, `str`, `CStr`, `OsStr`, and `Path`. - For `Rc<T>` and `Arc<T>`, `From<Cow>` is implemented for everything that implements `From` the borrowed and owned types separately.
2020-05-18Auto merge of #72289 - RalfJung:abort_internal, r=Mark-Simulacrumbors-23/+29
abort_internal is safe `sys::abort_internal` is stably exposed as a safe function. Forward that assumption "inwards" to the `sys` module by making the function itself safe, too. This corresponds to what https://github.com/rust-lang/rust/pull/72204 did for the intrinsic. We should probably wait until that lands because some of the intrinsic calls in this PR might then need adjustments.
2020-05-18Rollup merge of #72307 - hermitcore:condvar, r=Mark-SimulacrumRalf Jung-4/+2
use the new interface to initialize conditional variables HermitCore introduce a new interface to intialize conditional variables. Consequently, minor changes are required to support this interface.
2020-05-18minor changes to pass the format checkStefan Lankes-3/+1
2020-05-17use new interface to initialize CondvarStefan Lankes-5/+5
HermitCore introduce a new interface to intialize conditional variables. Consequently, minor changes are required to support this interface.
2020-05-17abort_internal is safeRalf Jung-23/+29
2020-05-17Auto merge of #72204 - RalfJung:abort, r=Mark-Simulacrumbors-4/+20
make abort intrinsic safe, and correct its documentation Turns out `std::process::abort` is not the same as the intrinsic, the comment was just wrong. Quoting from the unix implementation: ``` // On Unix-like platforms, libc::abort will unregister signal handlers // including the SIGABRT handler, preventing the abort from being blocked, and // fclose streams, with the side effect of flushing them so libc buffered // output will be printed. Additionally the shell will generally print a more // understandable error message like "Abort trap" rather than "Illegal // instruction" that intrinsics::abort would cause, as intrinsics::abort is // implemented as an illegal instruction. ```
2020-05-17make abort intrinsic safe, and correct its documentationRalf Jung-4/+20
2020-05-16Implement PartialOrd and Ord for SocketAddr*Hoe Hao Cheng-1/+146
2020-05-16Rollup merge of #72230 - SOF3:patch-1, r=kennytmDylan DPC-2/+2
Updated documentation of Prefix::VerbatimDisk PrefixComponent with Prefix::VerbatimDisk does not contain the trailing slash. The documentation here is also inconsistent with the documentation on other variants that reflect the `PrefixComponent::as_os_str()` return value.
2020-05-16Rollup merge of #71677 - Mark-Simulacrum:hasher-docs, r=AmanieuDylan DPC-0/+20
Add explicit references to the BuildHasher trait Fixes #71652
2020-05-16Rollup merge of #71662 - glandium:osstring_from_str, r=sfacklerDylan DPC-0/+10
Implement FromStr for OsString
2020-05-15Updated documentation of Prefix::VerbatimDiskSOFe-2/+2
PrefixComponent with Prefix::VerbatimDisk does not contain the trailing slash. The documentation here is also inconsistent with the documentation on other variants that reflect the `PrefixComponent::as_os_str()` return value.
2020-05-12Stabilize process_set_argv0 feature for UnixJeremy Fitzhardinge-2/+2
This stabilizes process_set_argv0 targeting 1.45.0. It has been useful in practice and seems useful as-is. The equivalent feature could be implemented for Windows, but as far as I know nobody has. That can be done separately. Tracking issue: #66510
2020-05-12Warn against thread::sleep in async fnKornel-0/+4
2020-05-11Fix clippy warningsMatthias Krüger-1/+1
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
2020-05-09Better documentation for io::Read::read() return valueElinvynia-0/+5
2020-05-07Rollup merge of #71980 - steveklabnik:warnings-fixes, r=Mark-SimulacrumDylan DPC-0/+6
Allow a few warnings. On Windows, these types were causing warnings to be emitted during the build. These types are allowed to not have idiomatic names, so the warning should be supressed.
2020-05-07Allow a few warnings.Steve Klabnik-0/+6
On Windows, these types were causing warnings to be emitted during the build. These types are allowed to not have idiomatic names, so the warning should be supressed.
2020-05-06Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppeDylan DPC-8/+7
use new interface to create threads on HermitCore - the new interface allows to define the stack size - increase the default stack size to 1 MByte
2020-05-06Rollup merge of #71921 - RalfJung:open-mode, r=hanna-kruppeDylan DPC-0/+4
explain the types used in the open64 call Fixes https://github.com/rust-lang/rust/issues/71915, where I learned about this quirk. I don't actually know what I am talking about here. ;)
2020-05-05explain the types used in the open64 callRalf Jung-0/+4
2020-05-05rely on rdlock/wrlock not returning anything but the specified error codesRalf Jung-2/+6
2020-05-04edit Mutex commentRalf Jung-4/+6
2020-05-04explain our rwlock implementation (and fix a potential data race)Ralf Jung-20/+24
2020-05-04expand comment on default mutex behaviorRalf Jung-3/+7
2020-05-03Rollup merge of #71398 - ThinkChaos:feat_refcell_take, r=LukasKalbertodtDylan DPC-1/+1
Add `RefCell::take` Add `RefCell::take` to match `Cell` and `Option`. I also changed a couple of calls to `.replace` to `.take`. Tracking issue is #71395. This is my first contribution, please tell me if there's anything I could improve, thanks!
2020-05-02Rollup merge of #71785 - reitermarkus:cfg-attribute, r=Mark-SimulacrumDylan DPC-7/+9
Update comment regarding SO_REUSEADDR on Windows
2020-05-02Replace `cfg` macro with attribute.Markus Reiter-7/+9
2020-05-02fix formatting issues that fail tidy testCarsten Andrich-16/+16
2020-05-02use or pattern to match error codes that map to ErrorKind::TimedOutCarsten Andrich-15/+15
2020-05-01Remove recommendation for unmaintained crateJacob Kiesel-1/+1
2020-05-01add Windows system error codes that map to io::ErrorKind::TimedOutCarsten Andrich-2/+35
2020-04-29Add explicit references to the BuildHasher traitMark Rousskov-0/+20
2020-04-29Rollup merge of #71296 - ChiefMilesEdgeworth:fix_doc_wording, r=Dylan-DPCDylan DPC-2/+3
Change wording on read_vectored docs Closes #70154 I'm happy to work with others to make the wording on this more clear. I think what I have is an improvement but may not be the final wording.
2020-04-29Implement FromStr for OsStringMike Hommey-0/+10