about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2019-01-17Make MutexGuard's Debug implementation more useful.Mara Bos-3/+7
Fixes #57702.
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-10/+6
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-17Document Unpin in std::prelude documentationKonrad Borowski-2/+3
2019-01-15OSX: fix #57534 registering thread dtors while running thread dtorstyler-24/+45
2019-01-15Add some links in std::fs.Eric Huss-5/+17
A few items were referenced, but did not have links.
2019-01-15Move spin_loop_hint to core::hint moduleClar Fon-0/+1
2019-01-15Stabilize FileExt::read_exact_at/write_all_atDror Levin-4/+2
Closes #51984.
2019-01-15Auto merge of #57130 - ↵bors-0/+19
VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-tier2_support, r=alexcrichton Upgrade x86_64-fortanix-unknown-sgx platform support to tier 2 ## Overview 1. This PR upgrades x86_64-fortanix-unknown-sgx platform support to tier 2 (std only) by setting up build automation for this target. 1. For supporting unwinding, this target needs to link to a port of LLVM's libunwind (more details could be found in #56979), which will be distributed along with the Rust binaries (similar to the extra musl objects) ### Building and copying libunwind: We have added a new build script (`build-x86_64-fortanix-unknown-sgx-toolchain.sh`) that will run while the container is built. This will build `libunwind.a` from git source. While the container is built, the persistent volumes where obj/ gets created aren't yet mapped. As a workaround, we copy the built `libunwind.a` to `obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-fortanix-unknown-sgx/lib/` after x.py runs. If any reviewer knows of a better solution, please do tell. r? @Mark-Simulacrum
2019-01-14Rollup merge of #57043 - ssomers:master, r=alexcrichtonMazdak Farrokhzad-7/+60
Fix poor worst case performance of set intersection Specifically, intersection of asymmetrically sized sets when the large set is on the left. See also the [latest answer on stackoverflow](https://stackoverflow.com/questions/35439376/python-set-intersection-is-faster-then-rust-hashset-intersection). Also applied to the union member, where the effect is much less but still measurable. Formatted the changed code only, does not increase the error count reported by tidy check, and tried to adhere to the spirit of the unit tests.
2019-01-14Rollup merge of #57584 - nnethercote:rm-connect_timeout_unroutable, r=sfacklerMazdak Farrokhzad-11/+0
Remove the `connect_timeout_unroutable` test. It requires an unreachable IP address, but there is no such thing, and this has caused it to fail for multiple people. Fixes #44698, fixes #50065. r? @sfackler
2019-01-14Stabilize `cfg_target_vendor`, #29718Jethro Beekman-1/+1
2019-01-14Remove the `connect_timeout_unroutable` test.Nicholas Nethercote-11/+0
It requires an unreachable IP address, but there is no such thing, and this has caused it to fail for multiple people. Fixes #44698, fixes #50065.
2019-01-13Cosmetic improvementsAlexander Regueiro-10/+6
2019-01-13Fix breakage from #56988 and workaround for #57569Vardhan Thigle-0/+9
2019-01-13Adding Build automation for x86_64-fortanix-unknown-sgxVardhan Thigle-0/+10
2019-01-13Rollup merge of #57473 - alexcrichton:hex-display-on-windows, r=KimundiMazdak Farrokhzad-1/+10
std: Render large exit codes as hex on Windows On Windows process exit codes are never signals but rather always 32-bit integers. Most faults like segfaults and such end up having large integers used to represent them, like STATUS_ACCESS_VIOLATION being 0xC0000005. Currently, however, when an `ExitStatus` is printed this ends up getting rendered as 3221225477 which is somewhat more difficult to debug. This commit adds a branch in `Display for ExitStatus` on Windows which handles exit statuses where the high bit is set and prints those exit statuses as hex instead of with decimals. This will hopefully preserve the current display for small exit statuses (like `exit code: 22`), but assist in quickly debugging segfaults/access violations/etc. I've found at least that the hex codes are easier to search for than decimal. I wasn't able to find any official documentation saying that all system exit codes have the high bit set, but I figure it's a good enough heuristic for now.
2019-01-12Rollup merge of #57511 - jethrogb:jb/fix-undef, r=cramertjMazdak Farrokhzad-2/+2
Fix undefined behavior From the [`MaybeUninit::get_mut` docs](https://doc.rust-lang.org/std/mem/union.MaybeUninit.html): > It is up to the caller to guarantee that the the MaybeUninit really is in an initialized state, otherwise this will immediately cause undefined behavior. r? @joshtriplett
2019-01-12Rollup merge of #57498 - steveklabnik:gh29008, r=alexcrichtonMazdak Farrokhzad-0/+2
make note of one more normalization that Paths do Fixes #29008
2019-01-12Rollup merge of #57450 - steveklabnik:gh45678, r=KodrAusMazdak Farrokhzad-3/+2
actually take a slice in this example Fixes #45678
2019-01-12Rollup merge of #57441 - ↵Mazdak Farrokhzad-11/+82
VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-backtrace-support, r=alexcrichton Supporting backtrace for x86_64-fortanix-unknown-sgx. # Overview Implementing following functions required by `libstd/sys_common` to support `backtrace`: ``` 1. unwind_backtrace 2. trace_fn 3. resolve_symname ``` # Description: The changes here are quite similar to the Cloudabi target `src/libstd/sys/cloudabi/backtrace.rs` The first 2 functions are implemented via calls to libunwind.a that is linked to the `x86_64-fortanix-unknown-sgx` (#56979), we have not implemented functionality needed by `resolve_symname` (or `dladdr`) to reduce SGX TCB. Rather, we print the function address (relative to enclave image base) in `resolve_symname` which can be later translated to correct symbol name (say, via `addr2line`). # Note: For `x86_64-fortanix-unknown-sgx`, the `RUST_BACKTRACE` environment has to be set from within the program running in an enclave. cc: @jethrogb r? @alexcrichton
2019-01-12Rollup merge of #57296 - ↵Mazdak Farrokhzad-1/+1
JosephTLyons:Fix-question-mark-operator-in-stdio-document, r=wesleywiser Fixed the link to the ? operator I'm working on updating all broken links, but figured I'd break up the pull requests so they are easier to review, versus just one big pull request.
2019-01-12Rollup merge of #57192 - czipperz:error_trait_doc_cause_to_source, r=wesleywiserMazdak Farrokhzad-7/+7
Change std::error::Error trait documentation to talk about `source` instead of `cause` Resolves #57056
2019-01-12Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obkbors-3/+3
Const-stabilize `const_int_ops` + `const_ip` r? @oli-obk ## Note for relnotes: This PR includes https://github.com/rust-lang/rust/pull/57105. I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment. ## Stable APIs proposed for constification + `const_int_ops`: + `count_ones` + `count_zeros` + `leading_zeros` + `trailing_zeros` + `swap_bytes` + `from_be` + `from_le` + `to_be` + `to_le` + `const_ip` + `Ipv4Addr::new` ## Unstable APIs constified + `const_int_conversion`: + `reverse_bits`
2019-01-11Fix undefined behaviorJethro Beekman-2/+2
2019-01-10Update src/libstd/path.rsMazdak Farrokhzad-1/+1
Co-Authored-By: steveklabnik <steve@steveklabnik.com>
2019-01-10make note of one more normalization that Paths doSteve Klabnik-0/+2
Fixes #29008
2019-01-10std: Render large exit codes as hex on WindowsAlex Crichton-1/+10
On Windows process exit codes are never signals but rather always 32-bit integers. Most faults like segfaults and such end up having large integers used to represent them, like STATUS_ACCESS_VIOLATION being 0xC0000005. Currently, however, when an `ExitStatus` is printed this ends up getting rendered as 3221225477 which is somewhat more difficult to debug. This commit adds a branch in `Display for ExitStatus` on Windows which handles exit statuses where the high bit is set and prints those exit statuses as hex instead of with decimals. This will hopefully preserve the current display for small exit statuses (like `exit code: 22`), but assist in quickly debugging segfaults/access violations/etc. I've found at least that the hex codes are easier to search for than decimal. I wasn't able to find any official documentation saying that all system exit codes have the high bit set, but I figure it's a good enough heuristic for now.
2019-01-09Fix poor worst case performance of is_disjointStein Somers-2/+5
2019-01-09actually take a slice in this exampleSteve Klabnik-3/+2
Fixes #45678
2019-01-09Merge remote-tracking branch 'upstream/master'Stein Somers-3774/+1106
2019-01-09Exposing enclave image-base to the enclave applicationVardhan Thigle-7/+5
image-base could be used by crates like backtrace to providing to make symbol resolution easier.
2019-01-08Change std::error::Error trait documentation to talk about `source` instead ↵Czipperz-7/+7
of `cause`
2019-01-08Auto merge of #56407 - GuillaumeGomez:missing-docs-reexported-macros, r=varkorbors-0/+1
check missing docs for reexported macros as well Fixes #56334.
2019-01-08Supporting backtrace for x86_64-fortanix-unknown-sgx.Vardhan Thigle-10/+83
2019-01-08Auto merge of #56988 - alexcrichton:monotonic-instant, r=sfacklerbors-13/+101
std: Force `Instant::now()` to be monotonic This commit is an attempt to force `Instant::now` to be monotonic through any means possible. We tried relying on OS/hardware/clock implementations, but those seem buggy enough that we can't rely on them in practice. This commit implements the same hammer Firefox recently implemented (noted in #56612) which is to just keep whatever the lastest `Instant::now()` return value was in memory, returning that instead of the OS looks like it's moving backwards. Closes #48514 Closes #49281 cc #51648 cc #56560 Closes #56612 Closes #56940
2019-01-07std: Force `Instant::now()` to be monotonicAlex Crichton-13/+101
This commit is an attempt to force `Instant::now` to be monotonic through any means possible. We tried relying on OS/hardware/clock implementations, but those seem buggy enough that we can't rely on them in practice. This commit implements the same hammer Firefox recently implemented (noted in #56612) which is to just keep whatever the lastest `Instant::now()` return value was in memory, returning that instead of the OS looks like it's moving backwards. Closes #48514 Closes #49281 cc #51648 cc #56560 Closes #56612 Closes #56940
2019-01-07Use correct tracking issue for c_variadicRyan Hunt-1/+1
Fixes #57306
2019-01-07Rollup merge of #57375 - stjepang:duration-constants, r=joshtriplettPietro Albini-0/+4
Add duration constants Add constants `SECOND`, `MILLISECOND`, `MICROSECOND`, and `NANOSECOND` to `core::time`. This will make working with durations more ergonomic. Compare: ```rust // Convenient, but deprecated function. thread::sleep_ms(2000); // The current canonical way to sleep for two seconds. thread::sleep(Duration::from_secs(2)); // Sleeping using one of the new constants. thread::sleep(2 * SECOND); ```
2019-01-07Specify the tracking issueStjepan Glavina-1/+1
2019-01-06check missing docs for reexported macros as wellGuillaume Gomez-0/+1
2019-01-06Re-export constants from core into stdStjepan Glavina-0/+4
2019-01-05Rollup merge of #57326 - king6cong:doc, r=rkruppekennytm-2/+2
Doc rewording, use the same name `writer` None
2019-01-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-3/+3
Fix repeated word typos Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo ](https://github.com/e-maxx-eng/e-maxx-eng/pull/389) Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05Rollup merge of #57312 - Mendess2526:master, r=Centrilkennytm-2/+2
`const fn` is no longer coming soon (const keyword docs) The `const` keyword [documentation](https://doc.rust-lang.org/std/keyword.const.html) mentions that `const fn`s are coming soon, but they have already been added.
2019-01-05Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAuskennytm-5/+5
Fix broken links to second edition TRPL. Fixes https://github.com/rust-lang/rust/issues/57104. Remove `second-edition/` from TRPL hyperlinks.
2019-01-05Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichtonkennytm-1/+10
Fix backtraces for inlined functions on Windows Fixes an regression introduced in https://github.com/rust-lang/rust/pull/50526 r? @alexcrichton
2019-01-04Doc rewording, use the same name `writer`king6cong-2/+2
2019-01-03Fix repeated word typosWiktor Kuchta-3/+3
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-03const fn no longer comming soon on const docsMendess2526-2/+2
2019-01-03Fixed the link to the ? operatorJoseph Lyons-1/+1