about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2018-12-24Rollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplettMazdak Farrokhzad-74/+357
Add `std::os::fortanix_sgx` module This PR adds the `std::os::sgx` module to expose platform-specific APIs behind the `sgx_platform` feature gate. Depends on https://github.com/rust-lang/rust/pull/56972 to be able to meaningfully build `std::os` documentation for non-standard targets. Tracking issue: https://github.com/rust-lang/rust/issues/56975
2018-12-23Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obkMazdak Farrokhzad-1/+0
Stabilize min_const_unsafe_fn in 1.33 Fixes #55607 r? @oli-obk
2018-12-23Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichtonMazdak Farrokhzad-3/+2
Pin stabilization This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items": > In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above). Let's settle these last bits here and get this thing stabilized! :) r? @alexcrichton cc @withoutboats
2018-12-23stabilize min_const_unsafe_fn in 1.33.Mazdak Farrokhzad-1/+0
2018-12-23Rollup merge of #57050 - RyanMarcus:master, r=zackmdaviskennytm-1/+1
Fixed typo in HashMap documentation Previously "with a custom type as key", now "with a custom key type"
2018-12-23Rollup merge of #57040 - otavio:topic/adjust-path_from_str-feature-gate, ↵kennytm-1/+1
r=Centril Fix feature gate to point to 1.32.0 for `path_from_str` When the feature has been added back (#55148) the feature gate has not been adjusted accordingly. We have it enabled for 1.32.0, currently in Beta, so adjust it. Refs: #44431. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-12-23Rollup merge of #57034 - Zoxc:query-perf8, r=michaelwoeristerkennytm-0/+3
Inline tweaks r? @michaelwoerister
2018-12-23Rollup merge of #56979 - VardhanThigle:Vardhan/rust-sgx-unwind-support, ↵kennytm-6/+139
r=alexcrichton Adding unwinding support for x86_64_fortanix_unknown_sgx target. Unwinding support is provided by our port of LLVM's libunwind which is available from https://github.com/fortanix/libunwind/tree/release_50. libunwind requires support for rwlock and printing to stderr, which is only provided by `std` for this target. This poses two problems: 1) how to expose the `std` functionality to C and 2) dependency inversion. ### Exposing `std` For exposing the functionality we chose to expose the following symbols: * __rust_rwlock_rdlock * __rust_rwlock_wrlock * __rust_rwlock_unlock * __rust_print_err * __rust_abort Also, the following are needed from `alloc`: * __rust_alloc * __rust_dealloc #### Rust RWLock in C In `libunwind`, RWLock is initialized as a templated static variable: ```c pthread_rwlock_t DwarfFDECache<A>::_lock = PTHREAD_RWLOCK_INITIALIZER; ``` I don't know of a good way to use the Rust sys::rwlock::RWLock type and initializer there. We could have a static global variable in Rust, but that doesn't work with the templating. The variable needs to be initialized statically, since this target doesn't support the .init section. Currently, I just used a byte array and standard C array initialization. The mapping between this C type and the Rust type needs to be manually maintained. There is a compile-time check and a unit test to make sure the Rust versions of these C definitions match the actual Rust type. If any reviewer knows of a better solution, please do tell. ### Dependency inversion issue `std` depends on `panic_unwind` which depends on `libunwind`, and `libunwind` depends on `std`. This is not normally supported by Rust's linking system. Therefore we use raw C exports from `std` *and* `libunwind.a` is linked last in the target `post_link_objects` instead of being built as part of the Rust `libunwind`. Currently, all C exports are defined in `src/libstd/sys/sgx/rwlock.rs` to overcome LTO issues. Only the `__rust_rwlock_*` definitions *need* to live there for privacy reasons. Once again, if any reviewer knows of a better solution, please do tell. r? @alexcrichton
2018-12-23Rollup merge of #56941 - euclio:deny-libstd-resolution-failures, ↵kennytm-1/+8
r=QuietMisdreavus deny intra-doc link resolution failures in libstd Fixes #56693. Until we land a fix for the underlying issue (#56922), we can at least fix the failures in libstd so they don't propagate to downstream crates.
2018-12-23Rollup merge of #56936 - ubsan:euclidean_div_rem, r=dtolnaykennytm-30/+30
rename div_euc -> div_euclid, and mod_euc -> rem_euclid logic is written up in #49048 Also, update the documentation slightly. cc @alexcrichton @clarcharr @varkor
2018-12-21Stabilize PinTaylor Cramer-2/+1
2018-12-21Update Pin API to match the one proposed for stabilizationTaylor Cramer-1/+1
Remove pin::Unpin reexport and add Unpin to the prelude. Change Pin associated functions to methods. Rename get_mut_unchecked_ to get_unchecked_mut Remove impl Unpin for Pin Mark Pin repr(transparent)
2018-12-21Auto merge of #56779 - adrian-budau:master, r=alexcrichtonbors-28/+78
On musl targets assume certain symbols exist (like pipe2 and accept4). This fixes #56675. I don't know if this is the best solution, or if I should also add some tests so I'm waiting for some feedback. Thanks!
2018-12-21Fixed typo in HashMap documentationRyan Marcus-1/+1
Previously "with a custom type as key", now "with a custom key type"
2018-12-21Properly report ENOSYS by modifying errnoAdrian Budau-22/+18
2018-12-21Fix feature gate to point to 1.32.0 for `path_from_str`Otavio Salvador-1/+1
When the feature has been added back (#55148) the feature gate has not been adjusted accordingly. We have it enabled for 1.32.0, currently in Beta, so adjust it. Refs: #44431. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-12-21Inline tweaksJohn Kåre Alsaker-0/+3
2018-12-21Auto merge of #56813 - oli-obk:main_🧶, r=pnkfelixbors-41/+0
Always run rustc in a thread cc @ishitatsuyuki @eddyb r? @pnkfelix [Previously](https://github.com/rust-lang/rust/pull/48575) we moved to only producing threads when absolutely necessary. Even before we opted to only create threads in some cases, which [is unsound](https://github.com/rust-lang/rust/pull/48575#issuecomment-380635967) due to the way we use thread local storage.
2018-12-20Auto merge of #54125 - varkor:less-conservative-uninhabitedness-check, ↵bors-0/+3
r=nikomatsakis Less conservative uninhabitedness check Extends the uninhabitedness check to structs, non-empty enums, tuples and arrays. Pulled out of #47291 and #50262. Fixes https://github.com/rust-lang/rust/issues/54586. r? @nikomatsakis
2018-12-20Fix typo in commentAdrian Budau-1/+1
2018-12-20Fix pipe2 and accept4 on static linked executables on linux (like musl).Adrian Budau-27/+81
2018-12-20Add `std::os::fortanix_sgx` moduleJethro Beekman-56/+325
2018-12-19Adding unwinding support for x86_64_fortanix_unknown_sgx target.Vardhan Thigle-6/+139
2018-12-19Rollup merge of #56363 - Lucretiel:patch-3, r=shepmasterPietro Albini-13/+10
Defactored Bytes::read Removed unneeded refactoring of read_one_byte, which removed the unneeded dynamic dispatch (`dyn Read`) used by that function. This function is only used in one place in the entire Rust codebase; there doesn't seem to be a reason for it to exist (and there especially doesn't seem to be a reason for it to use dynamic dispatch)
2018-12-19Revert "Remove some dead code from `sgx`"Jethro Beekman-0/+15
This reverts commit 134661917bf4b086b027a2c58219d50ba57a1453.
2018-12-19SGX target: fix docs buildJethro Beekman-2/+2
2018-12-19Show platform-specific modules in `std::os` when building those platformsJethro Beekman-17/+16
2018-12-17deny intra-doc link resolution failures in libstdAndy Russell-1/+8
2018-12-17Reordered match armsNathan West-1/+1
2018-12-17rename div_euc -> div_euclid, and mod_euc -> rem_euclidNicole Mazzuca-30/+30
logic is written up in https://github.com/rust-lang/rust/issues/49048 Also, update the documentation slightly
2018-12-16Rollup merge of #56858 - tbu-:pr_doc_canonicalize, r=shepmasterMazdak Farrokhzad-1/+1
Fix doc of `std::fs::canonicalize` Point out that the final component of the path name might be a filename (and not a directory name). Previously, the doc said that all components of the path must be directory names, when it actually only ment all but the final one. Fixes #54056.
2018-12-16Rollup merge of #56857 - tbu-:pr_doc_abssub, r=zackmdavisMazdak Farrokhzad-2/+4
Fix a small mistake regarding NaNs in a deprecation message `max` on floats returns the other argument if one of them is NaN, which would be `0.0` in this case. This is unlike the C functions `fdim` and `fdimf` which return NaN if either of their arguments is NaN. https://doc.rust-lang.org/1.31.0/std/primitive.f32.html#method.max https://en.cppreference.com/w/c/numeric/math/fdim
2018-12-16Rollup merge of #56832 - alexcrichton:external-demangle, r=Mark-SimulacrumMazdak Farrokhzad-228/+13
std: Use `rustc_demangle` from crates.io No more need to duplicate the demangling routine between crates.io and the standard library, we can use the exact same one!
2018-12-16Rollup merge of #56640 - myfreeweb:patch-1, r=alexcrichtonMazdak Farrokhzad-0/+8
Add FreeBSD unsigned char platforms to std::os::raw Reference: https://www.freebsd.org/cgi/man.cgi?query=arch&apropos=0&sektion=7
2018-12-15Fix doc of `std::fs::canonicalize`Tobias Bucher-1/+1
Point out that the final component of the path name might be a filename (and not a directory name). Previously, the doc said that all components of the path must be directory names, when it actually only ment all but the final one. Fixes #54056.
2018-12-15Fix a small mistake regarding NaNs in a deprecation messageTobias Bucher-2/+4
`max` on floats returns the other argument if one of them is NaN, which would be `0.0` in this case. This is unlike the C functions `fdim` and `fdimf` which return NaN if either of their arguments is NaN. https://doc.rust-lang.org/1.31.0/std/primitive.f32.html#method.max https://en.cppreference.com/w/c/numeric/math/fdim
2018-12-15Rollup merge of #56809 - dbrgn:permissions-ext, r=alexcrichtonPietro Albini-1/+2
Fix docs path to PermissionsExt Couldn't test the link yet, since I didn't figure out how to build std rustdocs without building the entire compiler itself :slightly_smiling_face:
2018-12-15Rollup merge of #56731 - GuillaumeGomez:ffi-doc-urls, r=CentrilPietro Albini-13/+15
Add missing urls in ffi module docs r? @QuietMisdreavus
2018-12-14std: Use `rustc_demangle` from crates.ioAlex Crichton-228/+13
No more need to duplicate the demangling routine between crates.io and the standard library, we can use the exact same one!
2018-12-14Remove dead codeOliver Scherer-41/+0
2018-12-14Auto merge of #56818 - kennytm:rollup-2, r=kennytmbors-27/+3
Rollup of 14 pull requests (first batch) Successful merges: - #56562 (Update libc version required by rustc) - #56609 (Unconditionally emit the target-cpu LLVM attribute.) - #56637 (rustdoc: Fix local reexports of proc macros) - #56658 (Add non-panicking `maybe_new_parser_from_file` variant) - #56695 (Fix irrefutable matches on integer ranges) - #56699 (Use a `newtype_index!` within `Symbol`.) - #56702 ([self-profiler] Add column for percent of total time) - #56708 (Remove some unnecessary feature gates) - #56709 (Remove unneeded extra chars to reduce search-index size) - #56744 (specialize: remove Boxes used by Children::insert) - #56748 (Update panic message to be clearer about env-vars) - #56749 (x86: Add the `adx` target feature to whitelist) - #56756 (Disable btree pretty-printers on older gdbs) - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic) r? @ghost
2018-12-14Rollup merge of #56748 - kinnison:kinnison/fix-56734, r=dtolnaykennytm-1/+2
Update panic message to be clearer about env-vars Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. I understand that this may simply be closed if the concept isn't accepted, and I'd be fine with that :-) Fixes #56734
2018-12-14Rollup merge of #56708 - oli-obk:stability_internal_const_fn, r=alexcrichtonkennytm-26/+1
Remove some unnecessary feature gates fixes #56585 cc @jethrogb
2018-12-14Auto merge of #56568 - notriddle:master, r=alexcrichtonbors-53/+209
Remove dependency on shell32.dll Closes #56510 if it works on MinGW (I've only tested it on MSVC).
2018-12-14Fix docs path to PermissionsExtDanilo Bargen-1/+2
2018-12-14Auto merge of #56490 - faern:add-checked-add-to-instant, r=alexcrichtonbors-166/+150
Add checked_add method to Instant time type Appending functionality to the already opened topic of `checked_add` on time types over at #55940. Doing checked addition between an `Instant` and a `Duration` is important to reliably determine a future instant. We could use this in the `parking_lot` crate to compute an instant when in the future to wake a thread up without risking a panic.
2018-12-14Auto merge of #56536 - alexcrichton:update-master, r=Mark-Simulacrumbors-8/+5
Bump to 1.33.0 * Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations
2018-12-13Update panic message to be clearer about env-varsDaniel Silverstone-1/+2
Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. Wording provided in part by David Tolnay.
2018-12-13Fix dur2intervals import on cloudabiLinus Färnstrand-5/+9
2018-12-13Fix checked_add/sub for sys/sgx/time.rsLinus Färnstrand-11/+7