about summary refs log tree commit diff
path: root/src/libstd/sys/windows
AgeCommit message (Collapse)AuthorLines
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
2018-08-24Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998kennytm-0/+2
Window Mutex: Document that we properly initialize the SRWLock See https://github.com/rust-lang/rust/issues/35836
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-1/+1
2018-08-15Start adding an `aarch64-pc-windows-msvc` targetAlex Crichton-4/+94
This commit adds the necessary definitions for target specs and such as well as the necessary support in libstd to compile basic `aarch64-pc-windows-msvc` binaries. The target is not currently built on CI, but it can be built locally with: ./configure --target=aarch64-pc-windows-msvc --set rust.lld ./x.py build src/libstd --target aarch64-pc-windows-msvc Currently this fails to build `libtest` due to a linker bug (seemingly in LLD?) which hasn't been investigate yet. Otherwise though with libstd you can build a hello world program (linked with LLD). I've not tried to execute it yet, but it at least links! Full support for this target is still a long road ahead, but this is hopefully a good stepping stone to get started. Points of note about this target are: * Currently defaults to `panic=abort` as support is still landing in LLVM for SEH on AArch64. * Currently defaults to LLD as a linker as I was able to get farther with it than I was with `link.exe`
2018-08-14fixed wordingRalf Jung-1/+1
2018-08-13Window Mutex: make sure we properly initialize the SRWLockRalf Jung-0/+2
2018-08-11Add links to std::char::REPLACEMENT_CHARACTER from docs.Corey Farwell-1/+2
There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
2018-08-02Auto merge of #52847 - upsuper:thread-stack-reserve, r=alexcrichtonbors-1/+4
Don't commit thread stack on Windows On Windows, there is a system level resource limitation called commit limit, which is roughly the sum of physical memory + paging files[1]. `CreateThread` by default commits the stack size[2], which unnecessarily takes such resource from the shared limit. This PR changes it to only reserve the stack size rather than commit it. Reserved memory would only take the address space of the current process until it's actually accessed. This should make the behavior on Windows match other platforms, and is also a pretty standard practice on Windows nowadays. [1] https://blogs.technet.microsoft.com/markrussinovich/2008/11/17/pushing-the-limits-of-windows-virtual-memory/ [2] https://docs.microsoft.com/zh-cn/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createthread
2018-07-30Don't commit thread stack on WindowsXidorn Quan-1/+4
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-6/+2
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-1/+1
2018-06-28Change traits to bare FnMut where possible.moxian-111/+67