Skip to content

Commit 7b03717

Browse files
committed
glib-macros: Improve error message when Properties struct doesn't have at least one #[property(…)]
1 parent 8922643 commit 7b03717

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

glib-macros/src/properties.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ impl Parse for PropsMacroInput {
8585
))
8686
}
8787
};
88+
if props.is_empty() {
89+
return Err(syn::Error::new(
90+
proc_macro2::Span::call_site(),
91+
"Struct must have at least one field with the #[property(…)] attribute",
92+
));
93+
}
8894
Ok(Self {
8995
wrapper_ty: attrs.wrapper_ty,
9096
ext_trait: attrs.ext_trait,

0 commit comments

Comments
 (0)