From 855acb4b75f07c8ba381b937994a10384c66b3c4 Mon Sep 17 00:00:00 2001 From: Arlie Davis Date: Thu, 6 Jun 2024 10:34:30 -0700 Subject: [PATCH 1/2] once more --- Cargo.toml | 3 +++ crates/libs/core/src/imp/weak_ref_count.rs | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0cd086c721..8c50093467 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,6 @@ rust_2018_idioms = { level = "warn", priority = -1 } unused_qualifications = "warn" missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] } + +# See https://github.com/microsoft/windows-rs/issues/3076 +unused-qualifications = { level = "allow" } diff --git a/crates/libs/core/src/imp/weak_ref_count.rs b/crates/libs/core/src/imp/weak_ref_count.rs index 92fcf67313..a6baa606b9 100644 --- a/crates/libs/core/src/imp/weak_ref_count.rs +++ b/crates/libs/core/src/imp/weak_ref_count.rs @@ -63,8 +63,7 @@ impl WeakRefCount { let tear_off = TearOff::new(object, count_or_pointer as u32); let tear_off_ptr: *mut c_void = transmute_copy(&tear_off); - let encoding: usize = - ((tear_off_ptr as usize) >> 1) | (1 << (core::mem::size_of::() * 8 - 1)); + let encoding: usize = ((tear_off_ptr as usize) >> 1) | (1 << (usize::BITS - 1)); loop { match self.0.compare_exchange_weak( From 9e288f2dd212d988cc45993e60350f2112ed3ad5 Mon Sep 17 00:00:00 2001 From: Arlie Davis Date: Thu, 6 Jun 2024 10:40:46 -0700 Subject: [PATCH 2/2] one day i'll be a real dev --- Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8c50093467..3eb997b1f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,6 @@ exclude = [ [workspace.lints.rust] rust_2018_idioms = { level = "warn", priority = -1 } -unused_qualifications = "warn" +unused_qualifications = "allow" # See https://github.com/microsoft/windows-rs/issues/3076 missing_docs = "warn" unexpected_cfgs = { level = "warn", check-cfg = ['cfg(windows_raw_dylib, windows_debugger_visualizer)'] } - -# See https://github.com/microsoft/windows-rs/issues/3076 -unused-qualifications = { level = "allow" }