AccessKit / accesskit

UI accessibility infrastructure across platforms and programming languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows adapter build fails when targeting 32-bit Windows.

bruvzg opened this issue · comments

commented

Building accesskit_windows v0.13.1 with --target=i686-pc-windows-msvc fails with the following mismatched types errors:

error[E0308]: mismatched types
    --> ~\.cargo\registry\src\github.com-1ecc6299db9ec823\accesskit_windows-0.13.1\src\subclass.rs:73:67
     |
73   |         self.prev_wnd_proc = unsafe { transmute::<isize, WNDPROC>(result) };
     |                                       --------------------------- ^^^^^^ expected `isize`, found `i32`
     |                                       |
     |                                       arguments to this function are incorrect
     |
note: function defined here
    --> ~\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\intrinsics.rs:1256:12
     |
1256 |     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
     |
73   |         self.prev_wnd_proc = unsafe { transmute::<isize, WNDPROC>(result.try_into().unwrap()) };
     |                                                                         ++++++++++++++++++++
error[E0308]: mismatched types
    --> ~\.cargo\registry\src\github.com-1ecc6299db9ec823\accesskit_windows-0.13.1\src\subclass.rs:84:17
     |
81   |             SetWindowLongPtrW(
     |             ----------------- arguments to this function are incorrect
...
84   |                 transmute::<WNDPROC, isize>(self.prev_wnd_proc),
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `isize`
     |
note: function defined here
    --> ~\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.44.0\src\Windows\Win32\UI\WindowsAndMessaging\mod.rs:3643:15
     |
3643 | pub unsafe fn SetWindowLongW<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
     |
84   |                 transmute::<WNDPROC, isize>(self.prev_wnd_proc).try_into().unwrap(),
     |                                                                ++++++++++++++++++++