microsoft/windows-app-rs

Feature "UI_Xaml" doesn't compile with windows-rs 0.29-git

mehmooda opened this issue · 3 comments

Problem

There seems to be a change in Vtable struct names.

Note: need to use windows-rs git to pass the missing Debug impl error

Specifically, when using windows-rs version 0.29, I get four different errors related to IVector_abi and IObservableVector_abi.

error[E0412]: cannot find type `IObservableVector_abi` in module `windows::Foundation::Collections`
    --> C:\Users\*\.cargo\git\checkouts\windows-app-rs-2b833a79998cddd6\5438301\src\Microsoft\UI\Xaml\mod.rs:5161:55
     |
5161 |       type Vtable = ::windows::Foundation::Collections::IObservableVector_abi<DependencyObject>;
     |                                                         ^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `IObservableVectorVtbl`
     |
    ::: C:\Users\*\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.29.0\src\Windows\Foundation\Collections\mod.rs:1233:1
     |
1233 | / pub struct IObservableVectorVtbl<T>(
1234 | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void, iid: &::windows::core::GUID, interface: *mut *mut ::core::ffi::c_void) ...
1235 | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> u32,
1236 | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> u32,
...    |
1244 | | where
1245 | |     T: ::windows::core::RuntimeType + 'static;
     | |______________________________________________- similarly named struct `IObservableVectorVtbl` defined here


error[E0412]: cannot find type `IVector_abi` in module `windows::Foundation::Collections`
     --> C:\Users\*\.cargo\git\checkouts\windows-app-rs-2b833a79998cddd6\5438301\src\Microsoft\UI\Xaml\mod.rs:32901:55
      |
32901 |       type Vtable = ::windows::Foundation::Collections::IVector_abi<TriggerAction>;
      |                                                         ^^^^^^^^^^^ help: a struct with a similar name exists: `IVectorVtbl`
      |
     ::: C:\Users\*\.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.29.0\src\Windows\Foundation\Collections\mod.rs:1676:1
      |
1676  | / pub struct IVectorVtbl<T>(
1677  | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void, iid: &::windows::core::GUID, interface: *mut *mut ::core::ffi::c_void) ...
1678  | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> u32,
1679  | |     pub unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> u32,
...     |
1697  | | where
1698  | |     T: ::windows::core::RuntimeType + 'static;
      | |______________________________________________- similarly named struct `IVectorVtbl` defined here

There was also an error relating to the Debug trait. This was a known problem introduced in windows-rs 0.29, and fixed in 0.30. The crate compiles without error when using windows-rs 0.28.

This should be fixed once windows-app-rs switches over to the new bindgen crate. @riverar

Yep, hoping to close all issues here with a new crate update!