about summary refs log tree commit diff
path: root/src/libstd/sys/windows
AgeCommit message (Collapse)AuthorLines
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
2018-11-25Auto merge of #55527 - sgeisler:time-checked-add, r=sfacklerbors-4/+12
Implement checked_add_duration for SystemTime [Original discussion on the rust user forum](https://users.rust-lang.org/t/std-systemtime-misses-a-checked-add-function/21785) Since `SystemTime` is opaque there is no way to check if the result of an addition will be in bounds. That makes the `Add<Duration>` trait completely unusable with untrusted data. This is a big problem because adding a `Duration` to `UNIX_EPOCH` is the standard way of constructing a `SystemTime` from a unix timestamp. This PR implements `checked_add_duration(&self, &Duration) -> Option<SystemTime>` for `std::time::SystemTime` and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many `add_duration(&self, &Duration) -> SystemTime` functions to avoid redundancy (they now unwrap the result of `checked_add_duration`). Some basic unit tests for the newly introduced function were added too. I wasn't sure which stabilization attribute to add to the newly introduced function, so I just chose `#[stable(feature = "time_checked_add", since = "1.32.0")]` for now to make it compile. Please let me know how I should change it or if I violated any other conventions. P.S.: I could only test on Linux so far, so I don't necessarily expect it to compile for all platforms.
2018-11-15Implement checked_add_duration for SystemTimeSebastian Geisler-4/+12
Since SystemTime is opaque there is no way to check if the result of an addition will be in bounds. That makes the Add<Duration> trait completely unusable with untrusted data. This is a big problem because adding a Duration to UNIX_EPOCH is the standard way of constructing a SystemTime from a unix timestamp. This commit implements checked_add_duration(&self, &Duration) -> Option<SystemTime> for std::time::SystemTime and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many add_duration(&self, &Duration) -> SystemTime functions to avoid redundancy (they now unwrap the result of checked_add_duration). Some basic unit tests for the newly introduced function were added too.
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-0/+85
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-06refactor: use shorthand fieldsteresy-2/+2
2018-09-07Fix tidy errorsJordan Rhee-1/+2
2018-09-04Add target thumbv7a-pc-windows-msvcJordan Rhee-1/+62
2018-09-01Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomezkennytm-1/+1
set cfg(rustdoc) when rustdoc is running on a crate When using `#[doc(cfg)]` to document platform-specific items, it's a little cumbersome to get all the platforms' items to appear all at once. For example, the standard library adds `--cfg dox` to rustdoc's command line whenever it builds docs, and the documentation for `#![feature(doc_cfg)]` suggests using a Cargo feature to approximate the same thing. This is a little awkward, because you always need to remember to set `--features dox` whenever you build documentation. This PR proposes making rustdoc set `#[cfg(rustdoc)]` whenever it runs on a crate, to provide an officially-sanctioned version of this that is set automatically. This way, there's a standardized way to declare that a certain version of an item is specifically when building docs. To try to prevent the spread of this feature from happening too quickly, this PR also restricts the use of this flag to whenever `#![feature(doc_cfg)]` is active. I'm sure there are other uses for this, but right now i'm tying it to this feature. (If it makes more sense to give this its own feature, i can easily do that.)
2018-08-31use cfg(rustdoc) instead of cfg(dox) in std and friendsQuietMisdreavus-1/+1
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-3/+3
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-27Fix anon param + make it allow-by-defMark Mansi-1/+8