Skip to content

Commit b8adb65

Browse files
QianNangonggitbot
authored and
gitbot
committed
Fix *-win7-windows-msvc target since c6643e0501a1ae5670ecd636bffa0a8ad762ca4e
1 parent 874c9e4 commit b8adb65

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

std/src/sys/pal/windows/c.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ compat_fn_with_fallback! {
204204
pub fn NtReleaseKeyedEvent(
205205
EventHandle: HANDLE,
206206
Key: *const c_void,
207-
Alertable: BOOLEAN,
207+
Alertable: bool,
208208
Timeout: *mut i64
209209
) -> NTSTATUS {
210210
panic!("keyed events not available")
@@ -213,7 +213,7 @@ compat_fn_with_fallback! {
213213
pub fn NtWaitForKeyedEvent(
214214
EventHandle: HANDLE,
215215
Key: *const c_void,
216-
Alertable: BOOLEAN,
216+
Alertable: bool,
217217
Timeout: *mut i64
218218
) -> NTSTATUS {
219219
panic!("keyed events not available")

std/src/sys/random/windows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn fill_bytes(mut bytes: &mut [u8]) {
1414
while !bytes.is_empty() {
1515
let len = bytes.len().try_into().unwrap_or(u32::MAX);
1616
let ret = unsafe { c::RtlGenRandom(bytes.as_mut_ptr().cast(), len) };
17-
assert_ne!(ret, 0, "failed to generate random data");
17+
assert!(ret, "failed to generate random data");
1818
bytes = &mut bytes[len as usize..];
1919
}
2020
}

std/src/sys/sync/mutex/windows7.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Mutex {
4444

4545
#[inline]
4646
pub fn try_lock(&self) -> bool {
47-
unsafe { c::TryAcquireSRWLockExclusive(raw(self)) != 0 }
47+
unsafe { c::TryAcquireSRWLockExclusive(raw(self)) }
4848
}
4949

5050
#[inline]

std/src/sys/sync/thread_parking/windows7.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ mod keyed_events {
195195

196196
pub unsafe fn park(parker: Pin<&Parker>) {
197197
// Wait for unpark() to produce this event.
198-
c::NtWaitForKeyedEvent(keyed_event_handle(), parker.ptr(), 0, ptr::null_mut());
198+
c::NtWaitForKeyedEvent(keyed_event_handle(), parker.ptr(), false, ptr::null_mut());
199199
// Set the state back to EMPTY (from either PARKED or NOTIFIED).
200200
// Note that we don't just write EMPTY, but use swap() to also
201201
// include an acquire-ordered read to synchronize with unpark()'s
@@ -218,7 +218,7 @@ mod keyed_events {
218218

219219
// Wait for unpark() to produce this event.
220220
let unparked =
221-
c::NtWaitForKeyedEvent(handle, parker.ptr(), 0, &mut timeout) == c::STATUS_SUCCESS;
221+
c::NtWaitForKeyedEvent(handle, parker.ptr(), false, &mut timeout) == c::STATUS_SUCCESS;
222222

223223
// Set the state back to EMPTY (from either PARKED or NOTIFIED).
224224
let prev_state = parker.state.swap(EMPTY, Acquire);
@@ -228,7 +228,7 @@ mod keyed_events {
228228
// was set to NOTIFIED, which means we *just* missed an
229229
// unpark(), which is now blocked on us to wait for it.
230230
// Wait for it to consume the event and unblock that thread.
231-
c::NtWaitForKeyedEvent(handle, parker.ptr(), 0, ptr::null_mut());
231+
c::NtWaitForKeyedEvent(handle, parker.ptr(), false, ptr::null_mut());
232232
}
233233
}
234234
pub unsafe fn unpark(parker: Pin<&Parker>) {
@@ -239,7 +239,7 @@ mod keyed_events {
239239
// To prevent this thread from blocking indefinitely in that case,
240240
// park_impl() will, after seeing the state set to NOTIFIED after
241241
// waking up, call NtWaitForKeyedEvent again to unblock us.
242-
c::NtReleaseKeyedEvent(keyed_event_handle(), parker.ptr(), 0, ptr::null_mut());
242+
c::NtReleaseKeyedEvent(keyed_event_handle(), parker.ptr(), false, ptr::null_mut());
243243
}
244244

245245
fn keyed_event_handle() -> c::HANDLE {

0 commit comments

Comments
 (0)