about summary refs log tree commit diff
path: root/src/libstd/sys/windows
AgeCommit message (Collapse)AuthorLines
2019-02-10libs: doc commentsAlexander Regueiro-7/+7
2019-02-10tests: doc commentsAlexander Regueiro-8/+8
2019-02-03Improve error message and docs for non-UTF-8 bytes in stdio on WindowsAustin Bonander-1/+3
cc #23344
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-2/+2
2019-01-23Add a comment on the meaning of Instant t: DurationAlex Berghage-0/+2
2019-01-22Rebase and fix new instantiation fnAlex Berghage-1/+1
2019-01-22Move Instant backing type to DurationAlex Berghage-22/+14
Per review comments, this commit switches out the backing type for Instant on windows to a Duration. Tests all pass, and the code's a lot simpler (plus it should be portable now, with the exception of the QueryPerformanceWhatever functions).
2019-01-22Simplify units in Duration/Instant math on WindowsAlex Berghage-42/+78
Right now we do unit conversions between PerfCounter measurements and nanoseconds for every add/sub we do between Durations and Instants on Windows machines. This leads to goofy behavior, like this snippet failing: ``` let now = Instant::now(); let offset = Duration::from_millis(5); assert_eq!((now + offset) - now, (now - now) + offset); ``` with precision problems like this: ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `4.999914ms`, right: `5ms`', src\main.rs:6:5 ``` To fix it, this changeset does the unit conversion once, when we measure the clock, and all the subsequent math in u64 nanoseconds. It also adds an exact associativity test to the `sys/time.rs` test suite to make sure we don't regress on this in the future.
2019-01-13Cosmetic improvementsAlexander Regueiro-3/+2
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-07std: Force `Instant::now()` to be monotonicAlex Crichton-0/+8
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-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-1/+1
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 #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-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-01privacy: Use common `DefId` visiting infra for all privacy visitorsVadim Petrochenkov-10/+0
2018-12-31Fix backtraces on WindowsJohn Kåre Alsaker-1/+10
2018-12-25Remove licensesMark Rousskov-379/+0
2018-12-21Auto merge of #56813 - oli-obk:main_🧶, r=pnkfelixbors-1/+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-14Remove dead codeOliver Scherer-1/+0
2018-12-14Auto merge of #56568 - notriddle:master, r=alexcrichtonbors-52/+209
Remove dependency on shell32.dll Closes #56510 if it works on MinGW (I've only tested it on MSVC).
2018-12-14Auto merge of #56490 - faern:add-checked-add-to-instant, r=alexcrichtonbors-36/+23
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-13Add checked_sub for Instant and SystemTimeLinus Färnstrand-16/+9
2018-12-13Add checked_add method to Instant time typeLinus Färnstrand-20/+14
2018-12-12Bump to 1.33.0Alex Crichton-1/+1
* Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations Actually updating the version number is blocked on updating Cargo
2018-12-11Use iterators instead of raw offsets in Windows argument parserMichael Howell-49/+45
2018-12-10Fix iterator nitsMichael Howell-18/+7
2018-12-10Fix nitMichael Howell-4/+6
Rewrite it to not use `if let`.
2018-12-10Fix nitsMichael Howell-3/+10
Add comments explaining how we test this, and use a slice for debugging instead of a clone of the iterator.
2018-12-10Fix poorly-transcribed test caseMichael Howell-3/+3
2018-12-10Fix nitpicksMichael Howell-23/+21
Switch to vec::IntoIter as our backing double-ended iterator. Fix incorrect comment.
2018-12-10Remove dependency on shell32.dll #56510Michael Howell-41/+206
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-8/+8
2018-12-07Auto merge of #56581 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 7 pull requests Successful merges: - #56000 (Add Armv8-M Mainline targets) - #56250 (Introduce ptr::hash for references) - #56434 (Improve query cycle errors for parallel queries) - #56516 (Replace usages of `..i + 1` ranges with `..=i`.) - #56555 (Send textual profile data to stderr, not stdout) - #56561 (Fix bug in from_key_hashed_nocheck) - #56574 (Fix a stutter in the docs for slice::exact_chunks) Failed merges: r? @ghost
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-1/+1
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-06Change sys::Thread::new to take the thread entry as Box<dyn FnBox() + 'static>̣Jethro Beekman-1/+2
2018-12-06Refactor stderr_prints_nothing into a more modular functionJethro Beekman-2/+2
2018-12-05Rollup merge of #56497 - ljedrz:cleanup_libstd_const_lifetimes, r=kennytmPietro Albini-10/+10
cleanup: remove static lifetimes from consts in libstd
2018-12-05Rollup merge of #56119 - frewsxcv:frewsxcv-option-carrier, r=TimNNPietro Albini-4/+1
Utilize `?` instead of `return None`. None
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-1/+1
2018-12-04Utilize `?` instead of `return None`.Corey Farwell-4/+1
2018-12-04cleanup: remove static lifetimes from consts in libstdljedrz-10/+10
2018-12-03Rollup merge of #56419 - mark-i-m:remove-try, r=Centrilkennytm-2/+2
Remove some uses of try!
2018-12-02no reason to use mutable references here at allRalf Jung-12/+4
2018-12-01remove some uses of try!Mark Mansi-2/+2
2018-11-28get_ref -> get_mutRalf Jung-8/+8
2018-11-28fix buildRalf Jung-5/+13
2018-11-28put the MaybeUninit inside the UnsafeCellRalf Jung-10/+7
2018-11-27add comments explaining our uses of get_ref/get_mut for MaybeUninitRalf Jung-0/+3
2018-11-27fix buildRalf Jung-1/+1
2018-11-27use MaybeUninit instead of mem::uninitialized for Windows MutexRalf Jung-9/+9