Skip to content

Commit 2d95076

Browse files
authored
Update windows-sys crate to its latest major version (#11199)
Keeping up-to-date
1 parent 2bac657 commit 2d95076

File tree

6 files changed

+172
-36
lines changed

6 files changed

+172
-36
lines changed

Cargo.lock

Lines changed: 96 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ object = { version = "0.36.5", default-features = false, features = ['read_core'
349349
gimli = { version = "0.31.0", default-features = false, features = ['read'] }
350350
addr2line = { version = "0.24.1", default-features = false }
351351
anyhow = { version = "1.0.93", default-features = false }
352-
windows-sys = "0.59.0"
352+
windows-sys = "0.60.0"
353353
env_logger = "0.11.5"
354354
log = { version = "0.4.27", default-features = false }
355355
clap = { version = "4.5.17", default-features = false, features = ["std", "derive"] }

crates/cache/src/worker.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,7 @@ impl WorkerThread {
238238
// https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadpriority
239239
// https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities
240240

241-
if unsafe {
242-
SetThreadPriority(
243-
GetCurrentThread(),
244-
THREAD_MODE_BACKGROUND_BEGIN.try_into().unwrap(),
245-
)
246-
} == 0
247-
{
241+
if unsafe { SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN) } == 0 {
248242
warn!(
249243
"Failed to lower worker thread priority. It might affect application performance."
250244
);

crates/wasi-nn/src/backend/winml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl BackendInner for WinMLBackend {
3535

3636
fn load(&mut self, builders: &[&[u8]], target: ExecutionTarget) -> Result<Graph, BackendError> {
3737
if builders.len() != 1 {
38-
return Err(BackendError::InvalidNumberOfBuilders(1, builders.len()).into());
38+
return Err(BackendError::InvalidNumberOfBuilders(1, builders.len()));
3939
}
4040

4141
let model_stream = InMemoryRandomAccessStream::new()?;
@@ -83,7 +83,7 @@ unsafe impl Sync for WinMLGraph {}
8383

8484
impl BackendGraph for WinMLGraph {
8585
fn init_execution_context(&self) -> Result<ExecutionContext, BackendError> {
86-
let device = LearningModelDevice::Create(self.device_kind.clone())?;
86+
let device = LearningModelDevice::Create(self.device_kind)?;
8787
let session = LearningModelSession::CreateFromModelOnDevice(&self.model, &device)?;
8888
let box_: Box<dyn BackendExecutionContext> = Box::new(WinMLExecutionContext::new(session));
8989
Ok(box_.into())

crates/wasmtime/src/runtime/vm/sys/windows/unwind64.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ impl UnwindRegistration {
2525
assert!(unwind_info as usize % 4 == 0);
2626
let unit_len = mem::size_of::<Entry>();
2727
assert!(unwind_len % unit_len == 0);
28-
if RtlAddFunctionTable(
28+
if !RtlAddFunctionTable(
2929
unwind_info as *mut Entry,
3030
(unwind_len / unit_len).try_into().unwrap(),
3131
base_address as _,
32-
) == 0
33-
{
32+
) {
3433
bail!("failed to register function table");
3534
}
3635

0 commit comments

Comments
 (0)