Commit Graph

2131 Commits

Author SHA1 Message Date
David Cook
100141f57c Remove null checks, fall through to UB upon deref 2020-04-05 12:32:09 -05:00
David Cook
79f3307f30 Update comments, rearrange code 2020-04-05 12:09:31 -05:00
David Cook
ac8c98da8e Store layouts of i32 and u32 inside Evaluator 2020-04-05 10:37:57 -05:00
David Cook
8293d80b53 Set explicit return value size for windows shim 2020-04-05 10:36:14 -05:00
David Cook
e1a1592991 Set some explicit return value sizes 2020-04-05 10:35:08 -05:00
David Cook
37ddde9f70 Implement TryEnterCriticalSection 2020-04-05 10:33:32 -05:00
David Cook
7f6df15aa2 Rearrange functions 2020-04-05 10:32:06 -05:00
David Cook
c7466c9531 Add TerminationInfo::Deadlock, use in mutex shim 2020-04-05 10:32:01 -05:00
David Cook
735fc12e1a Handle variation in layout of pthread_mutex_t 2020-04-05 10:27:31 -05:00
David Cook
e5e3256b59 Address review comments 2020-04-05 10:10:35 -05:00
David Cook
ba3884dae6 Use checked addition/subtraction on lock counts 2020-04-05 10:08:39 -05:00
David Cook
141319a412 Refactor sync shims with setters and getters 2020-04-05 10:07:39 -05:00
David Cook
fd94255b9d Add comments explaining asserts 2020-04-05 10:06:37 -05:00
David Cook
d11315ebfb Fix misleading function names 2020-04-05 10:05:34 -05:00
David Cook
765050f302 Revise mutex/rwlock memory layout for macOS compat 2020-04-05 10:03:29 -05:00
David Cook
dd9896b0f8 Implement mutex and rwlock functions 2020-04-05 10:03:22 -05:00
David Cook
88f319fb4c Add failing tests for mutex and rwlock 2020-04-05 09:25:21 -05:00
David Cook
46679bc9ef Add shims for RwLock::try_read/RwLock::try_write 2020-04-05 09:25:21 -05:00
bors
26d7e9bd23 Auto merge of #1300 - RalfJung:rust-src, r=RalfJung
Rust bootstrap sysroot now has src in the same place as rust-src

So we can remove a special hack. I checked this locally to confirm it works.

Cc https://github.com/rust-lang/rust/pull/70642 @eddyb
2020-04-04 14:46:40 +00:00
Ralf Jung
bd9ec746a5 Rust bootstrap sysroot now has src in the same place as rust-src, so remove special hack 2020-04-04 12:07:22 +02:00
bors
0e8a1a40f2 Auto merge of #1294 - JOE1994:windows_instant, r=RalfJung
Add support for 'std::time::Instant' in Windows

Add support for creating `std::time::Instant` in Windows

Includes shims for `QueryPerformanceCounter` & `QueryPerformanceFrequency` in Windows, which are both called in Windows when `std::time::Instant` is created.

Windows docs page ["Acquiring high-resolution time stamps"](https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps) was helpful in learning how `QueryPerformanceCounter` & `QueryPerformanceFrequency` work.

closes #1291
2020-04-03 06:36:15 +00:00
Ralf Jung
9f3383d55d rustup for import changes 2020-04-03 00:05:35 +02:00
Youngsuk Kim
f762c70b51
Update comments in src/shims/time.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-04-02 16:04:50 -04:00
Youngsuk Kim
5157b8769f
Update comments in src/shims/time.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-04-02 16:04:10 -04:00
Youngsuk Kim
a494825d5a
Update comments in src/shims/time.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
2020-04-02 16:03:56 -04:00
Ralf Jung
d5beecb79c correct factual mistake in Windows message, and use "+" sugar 2020-04-02 15:16:20 +02:00
Ralf Jung
5ce2466892 fix for FieldPlacement rename 2020-04-02 09:19:56 +02:00
Ralf Jung
f599687f3f adjust for span not being passed around any more 2020-04-02 09:14:17 +02:00
Ralf Jung
5130aa55a2 adjust stacktrace printing to rustc changes 2020-04-02 09:14:17 +02:00
JOE1994
ff982b1821 fix incorrect error message in shim 'QueryPerformanceCounter' 2020-04-01 21:26:47 -04:00
JOE1994
957ec2be10 Add support for 'std::time::Instant' in Windows 2020-04-01 20:35:56 -04:00
bors
6536f3165e Auto merge of #1290 - RalfJung:rustup, r=RalfJung
Rustup

Also remove ICEing `breakpoint` intrinsic shim.
2020-04-01 17:59:33 +00:00
Ralf Jung
1e3800ffb1 rustup 2020-04-01 19:40:10 +02:00
Ralf Jung
3911388e06 remove ICEin intrinsic 2020-04-01 19:12:26 +02:00
JOE1994
b3f9e53049 Implement 'GetSystemTimeAsFileTime' shim for Windows 2020-04-01 10:55:26 -04:00
Ralf Jung
1cfd80ea2d rustup; fix Windows env var memory type 2020-03-30 22:13:53 +02:00
bors
319f2dd9e1 Auto merge of #1279 - divergentdave:open_O_EXCL, r=RalfJung
Add support for OpenOptions::create_new()/O_EXCL

This PR extends the POSIX shim for `open` to support the `O_EXCL` flag, when it is used alongside `O_CREAT`, and exercises it by testing `OpenOptions::create_new`.
2020-03-30 15:49:45 +00:00
Ralf Jung
8948a29a4c adjust for librustc rename; reduce 'extern crate' to rustc crates 2020-03-30 11:07:32 +02:00
Ralf Jung
5ff7eef2ff rustup; fix for TyLayout rename 2020-03-30 10:23:04 +02:00
David Cook
808709c288 Add support for OpenOptions::create_new()/O_EXCL 2020-03-29 16:06:41 -05:00
JOE1994
ed1305d986 fix fn read_path_from_wide_str 2020-03-29 16:01:07 -04:00
JOE1994
a458cf3fe6 make 'fn convert_path_separator' to take Cow<> (to remove unnecessary allocation) 2020-03-29 14:19:59 -04:00
JOE1994
9bdb4bbbbf Move definition of 'fn windows_check_buffer_size' to top of 'src/shims/env.rs' 2020-03-29 13:13:42 -04:00
JOE1994
1b0abc5797 small refactorings to 'src/shims/os_str.rs' & 'src/shims/env.rs' 2020-03-29 13:10:23 -04:00
JOE1994
1667ded0d2 fix fn GetCurrentDirectoryW + clarify return types of Windows shims 2020-03-29 11:30:42 -04:00
JOE1994
7e0cc8307e fix 'magic boolean' to enum 2020-03-29 11:30:08 -04:00
JOE1994
fe9ecb50d1 Follow-up to reviews from RalfJung
1. Fix 'fn convert_path_separator' in src/shims/os_str.rs
2. Fix 'fn set_last_error_from_io_error' in src/helpers.rs
3. Minor comment fix for 'fn SetCurrentDirectoryW' in src/shims/env.rs
2020-03-29 11:30:08 -04:00
JOE1994
1141b21e50 Windows shims for GetCurrentDirectoryW/SetCurrentDirectoryW 2020-03-29 11:30:08 -04:00
JOE1994
a481b8f261 partially implement 'set_last_error_from_io_error' for Windows 2020-03-29 11:30:08 -04:00
Ralf Jung
f181e75db2 rustup 2020-03-29 10:01:31 +02:00