You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building with a toolchain target of i686-pc-windows-msvc building the crate fails with the following two errors:
error[E0308]: mismatched types
--> C:\--snip--\accesskit_windows-0.12.0\src\subclass.rs:69:67
|
69 | self.prev_wnd_proc = unsafe { transmute::<isize, WNDPROC>(result) };
| --------------------------- ^^^^^^ expected `isize`, found `i32`
| |
| arguments to this function are incorrect
|
note: function defined here
--> C:\--snip--\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\intrinsics.rs:1251:12
|
1251 | pub fn transmute<Src, Dst>(src: Src) -> Dst;
| ^^^^^^^^^
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
69 | self.prev_wnd_proc = unsafe { transmute::<isize, WNDPROC>(result.try_into().unwrap()) };
| ++++++++++++++++++++
and
error[E0308]: mismatched types
--> C:\--snip--\accesskit_windows-0.12.0\src\subclass.rs:80:17
|
77 | SetWindowLongPtrW(
| ----------------- arguments to this function are incorrect
...
80 | transmute::<WNDPROC, isize>(self.prev_wnd_proc),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `isize`
|
note: function defined here
--> C:\--snip--\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.42.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:4776:15
|
4776 | pub unsafe fn SetWindowLongW<'a, P0>(hwnd: P0, nindex: WINDOW_LONG_PTR_INDEX, dwnewlong: i32) -> i32
| ^^^^^^^^^^^^^^
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
80 | transmute::<WNDPROC, isize>(self.prev_wnd_proc).try_into().unwrap(),
| ++++++++++++++++++++
Best I can tell, you're using SetWindowLongPtrW which returns an isize; however, the windows crate has these few lines (in "WindowsAndMessaging/mod.rs":15914):
#[cfg(target_pointer_width = "32")]
#[cfg(feature = "Win32_Foundation")]
pub use SetWindowLongW as SetWindowLongPtrW;
This replaceses SetWindowLongPtrW with SetWindowLongW which returns an i32 instead of an isize. I have not done much work in the depths of Win32, so I have no idea why that would be. It seems like a silly choice to make on the surface.
The text was updated successfully, but these errors were encountered:
I think the issue you're hitting has been fixed in #223 and included in accesskit_windows 0.13.2. From the error messages it looks like you're using version 0.12.0. Can you please update your version and let us know if it solves your issue?
That fix looks like exactly what would be causing the issue. Your crate is actually used by egui, a gui library that I'm using. I'll submit an issue for them to update their library. Thanks for the quick response.
When building with a toolchain target of i686-pc-windows-msvc building the crate fails with the following two errors:
and
Best I can tell, you're using
SetWindowLongPtrW
which returns anisize
; however, the windows crate has these few lines (in "WindowsAndMessaging/mod.rs":15914):This replaceses
SetWindowLongPtrW
withSetWindowLongW
which returns an i32 instead of an isize. I have not done much work in the depths of Win32, so I have no idea why that would be. It seems like a silly choice to make on the surface.The text was updated successfully, but these errors were encountered: