Skip to content

Commit

Permalink
Remove workaround for empty structs (#3016)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored May 3, 2024
1 parent 2b1cd63 commit d5f2ead
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions crates/libs/bindgen/src/rust/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ pub fn writer(writer: &Writer, def: metadata::TypeDef) -> TokenStream {

fn gen_struct_with_name(writer: &Writer, def: metadata::TypeDef, struct_name: &str, cfg: &cfg::Cfg) -> TokenStream {
let name = to_ident(struct_name);

if def.fields().next().is_none() {
let mut tokens = quote! {
#[repr(C)]
pub struct #name(pub u8);
impl Copy for #name {}
impl Clone for #name {
fn clone(&self) -> Self {
*self
}
}
};
if !writer.sys {
tokens.combine(&quote! {
impl windows_core::TypeKind for #name {
type TypeKind = windows_core::CopyType;
}
});
}
return tokens;
}

let flags = def.flags();
let cfg = cfg.union(cfg::type_def_cfg(writer, def, &[]));

Expand Down

0 comments on commit d5f2ead

Please sign in to comment.