Skip to content

Commit

Permalink
Add missing :: to core reference in macro (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 authored Dec 17, 2021
1 parent f0c3723 commit 7865fa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/libs/macros/src/implement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn gen(attribute: proc_macro::TokenStream, original_type: proc_macro::TokenS
}
impl<#constraints> ::windows::core::ToImpl<#interface_ident> for #impl_ident {
unsafe fn to_impl(interface: &#interface_ident) -> &mut Self {
let this: ::windows::core::RawPtr = core::mem::transmute_copy(interface);
let this: ::windows::core::RawPtr = ::core::mem::transmute_copy(interface);
let this = (this as *mut ::windows::core::RawPtr).sub(2 + #interface_count) as *mut #box_ident::<#(#generics,)*>;
&mut (*this).implementation
}
Expand All @@ -179,7 +179,7 @@ pub fn gen(attribute: proc_macro::TokenStream, original_type: proc_macro::TokenS
let mut phantoms = TokenStream::new();

for _ in 0..def.generic_params().count() {
phantoms.combine(&quote! { core::marker::PhantomData, })
phantoms.combine(&quote! { ::core::marker::PhantomData, })
}

vtable_ctors.combine(&quote! {
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn gen(attribute: proc_macro::TokenStream, original_type: proc_macro::TokenS
}
}
impl <#constraints> ::windows::core::Compose for #impl_ident {
unsafe fn compose<'a>(implementation: Self) -> (::windows::core::IInspectable, &'a mut core::option::Option<::windows::core::IInspectable>) {
unsafe fn compose<'a>(implementation: Self) -> (::windows::core::IInspectable, &'a mut ::core::option::Option<::windows::core::IInspectable>) {
let inspectable: ::windows::core::IInspectable = implementation.into();
let this = (&inspectable as *const _ as *mut ::windows::core::RawPtr).sub(1) as *mut #box_ident::<#(#generics,)*>;
(inspectable, &mut (*this).base)
Expand Down

0 comments on commit 7865fa1

Please sign in to comment.