summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2019-07-03fix unused-import error on androidRalf Jung-2/+1
2019-07-03Rollup merge of #62304 - SimonSapin:safe, r=eddybMark Rousskov-0/+12
HashMap is UnwindSafe Fixes https://github.com/rust-lang/rust/issues/62301, a regression in 1.36.0-pre which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
2019-07-03Rollup merge of #62183 - alexcrichton:fix-tests, r=nikomatsakisMark Rousskov-27/+0
std: Move a process test out of libstd This commit moves a test out of libstd which is causing deadlocks on musl on CI. Looks like the recent update in musl versions brings in some internal updates to musl which makes `setgid` and `setuid` invalid to call after a `fork` in a multithreaded program. The issue seen here is that the child thread was attempting to grab a lock held by a nonexistent thread, meaning that the child process simply deadlocked causing the whole test to deadlock. This commit moves the test to its own file with no threads which should work.
2019-07-02HashMap is UnwindSafeSimon Sapin-0/+12
Fixes https://github.com/rust-lang/rust/issues/62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
2019-07-02improve and deduplicate commentsRalf Jung-4/+3
2019-07-02request at least ptr-size alignment from posix_memalignRalf Jung-1/+11
2019-07-01Enable mem_take feature in relevant cratesChris Gregory-0/+1
2019-07-01Convert more usages overChris Gregory-3/+3
2019-07-01Remove needless lifetimesJeremy Stucki-7/+7
2019-06-30Extend the #[must_use] lint to boxed typesvarkor-1/+3
2019-06-29Rollup merge of #62163 - cuviper:unix-uninit, r=RalfJungMazdak Farrokhzad-61/+58
Avoid mem::uninitialized() in std::sys::unix For `libc` types that will be initialized in FFI calls, we can just use `MaybeUninit` and then pass around raw pointers. For `sun_path_offset()`, which really wants `offset_of`, all callers have a real `sockaddr_un` available, so we can use that reference. r? @RalfJung
2019-06-27Rollup merge of #62102 - RalfJung:read, r=CentrilMazdak Farrokhzad-1/+10
call out explicitly that general read needs to be called with an initialized buffer
2019-06-27Rollup merge of #62043 - Centril:remove-fnbox, r=cramertjMazdak Farrokhzad-1/+0
Remove `FnBox` Remove `FnBox` since we now have `Box<dyn FnOnce>`. Closes https://github.com/rust-lang/rust/issues/28796. r? @cramertj
2019-06-27std: Move a process test out of libstdAlex Crichton-27/+0
This commit moves a test out of libstd which is causing deadlocks on musl on CI. Looks like the recent update in musl versions brings in some internal updates to musl which makes `setgid` and `setuid` invalid to call after a `fork` in a multithreaded program. The issue seen here is that the child thread was attempting to grab a lock held by a nonexistent thread, meaning that the child process simply deadlocked causing the whole test to deadlock. This commit moves the test to its own file with no threads which should work.
2019-06-26Use pointer::write_bytes for android sigemptysetJosh Stone-5/+3
2019-06-26Avoid mem::uninitialized() in std::sys::unixJosh Stone-58/+57
For `libc` types that will be initialized in FFI calls, we can just use `MaybeUninit` and then pass around raw pointers. For `sun_path_offset()`, which really wants `offset_of`, all callers have a real `sockaddr_un` available, so we can use that reference.
2019-06-25tweak wordingRalf Jung-3/+3
2019-06-24call out explicitly that general read needs to be called with an initialized ↵Ralf Jung-1/+10
buffer
2019-06-22Remove FnBox.Mazdak Farrokhzad-1/+0
2019-06-22TypoFelix Rabe-1/+1
2019-06-20Rollup merge of #61900 - s3bk:master, r=sfacklerMazdak Farrokhzad-0/+4
implement Error::source for Box<T: Error> fixes https://github.com/rust-lang/rust/issues/61899
2019-06-20Add a few trait impls for AccessErrorStjepan Glavina-0/+4
2019-06-20Auto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichtonbors-223/+184
macos tlv workaround fixes: #60141 Includes: * remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655) * redox had a copy of `fast::Key` (not sure why?). That has been removed. * Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1. `tlv_get_addr` is relatively expensive (~1.5ns on my machine). Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match. After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined. I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither. r? @alexcrichton
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-1/+1
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-1/+1
Clone for it.
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-2/+2
2019-06-17implement Error::source for Box<T: Error>s3bk-0/+4
fixes https://github.com/rust-lang/rust/issues/61899
2019-06-16Stabilize todo macroStjepan Glavina-1/+0
2019-06-14make sure we use cfg-if as a std dependencyRalf Jung-1/+1
2019-06-13Rollup merge of #61757 - sfackler:deprecate-once-init, r=alexcrichtonMazdak Farrokhzad-0/+6
Deprecate ONCE_INIT in future 1.38 release Once::new() has been a stable const fn for a while now. Closes #61746
2019-06-13Rollup merge of #61720 - alexcrichton:libstd-cfg-if-dep, r=sfacklerMazdak Farrokhzad-43/+14
std: Remove internal definitions of `cfg_if!` macro This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
2019-06-12Deprecate ONCE_INITSteven Fackler-0/+6
Once::new() has been a stable const fn for a while now. Closes #61746
2019-06-12Hygienize macros in the standard libraryVadim Petrochenkov-8/+8
2019-06-11Rollup merge of #61652 - JohnTitor:docs-improve-array, r=CentrilMazdak Farrokhzad-2/+12
Mention slice patterns in array Fixes #61650 r? @scottmcm
2019-06-10std: Remove internal definitions of `cfg_if!` macroAlex Crichton-43/+14
This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
2019-06-10Add an exampleYuki Okushi-0/+10
2019-06-08Mention slice patternsYuki Okushi-2/+2
2019-06-08Rollup merge of #61647 - JohnTitor:use-stable-func, r=CentrilMazdak Farrokhzad-2/+2
Use stable wrappers in f32/f64::signum Fixes #61638 r? @Centril
2019-06-08Rollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obkMazdak Farrokhzad-0/+4
Document tuple's Ord behavior as sequential Partially closing #50727
2019-06-08Use stable wrappersYuki Okushi-2/+2
2019-06-07Rollup merge of #61603 - Goirad:increase-sgx-heapsize, r=alexcrichtonMazdak Farrokhzad-0/+2
Increases heap size available during testing for SGX PR [61540](https://github.com/rust-lang/rust/pull/61540) causes at least one test to fail when run for the SGX platform due to lack of memory. This PR increases the heapsize available during tests, which is a good thing regardless of the status of that PR.
2019-06-06increase max heapsize available during sgx testsDario Gonzalez-0/+2
2019-06-06Update compiler_builtinsvarkor-1/+1
2019-06-06Auto merge of #57428 - alexreg:associated_type_bounds, r=nikomatsakis,Centrilbors-3/+4
Implementation of RFC 2289 (associated_type_bounds) This PR implements the [`asociated_type_bounds` feature](https://github.com/rust-lang/rfcs/blob/master/text/2289-associated-type-bounds.md). Associated type bounds are implemented in: - function/method arguments and return types - structs, enums, unions - associated items in traits - type aliases - type parameter defaults - trait objects - let bindings CC @nikomatsakis @centril
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-3/+4
2019-06-05Rollup merge of #61534 - ReinierMaas:patch-1, r=CentrilMazdak Farrokhzad-1/+4
Edit docs of ExitStatus The documentation of [`ExitStatus`] are extended to be at the same depth as [`Output`].
2019-06-05Rollup merge of #61503 - jethrogb:jb/fix-sgx-test, r=alexcrichtonMazdak Farrokhzad-1/+2
Fix cfg(test) build for x86_64-fortanix-unknown-sgx
2019-06-05Auto merge of #61502 - alexcrichton:update-backtrace, r=estebankbors-1/+1
std: Update dependency on `backtrace` Discovered in #61416 an accidental regression in libstd's backtrace behavior is that it previously attempted to consult libbacktrace and would then fall back to `dladdr` if libbacktrace didn't report anything. The `backtrace` crate, however, did not do this, so that's now been fixed! Changes: https://github.com/rust-lang/backtrace-rs/compare/0.3.25...0.3.29 Closes #61416
2019-06-05Tidy: trailing whitespaceReinier Maas-1/+1
Removed trailing whitespace from documentation of ExitStatus.
2019-06-05Edit docs of ExitStatusReinier Maas-1/+4
The documentation of [`ExitStatus`] are extended to be at the same depth as [`Output`].