Error when derive(Outgoing) is used on a type with generics

This commit is contained in:
Jonas Platte 2019-11-26 22:36:58 +01:00
parent 6f7eb126f6
commit 7d340942a0
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -12,6 +12,13 @@ mod wrap_incoming;
use wrap_incoming::Meta;
pub fn expand_derive_outgoing(input: DeriveInput) -> syn::Result<TokenStream> {
if !input.generics.params.is_empty() {
return Err(syn::Error::new_spanned(
input.generics,
"derive(Outgoing) doesn't currently support types with generics!",
));
}
let derive_deserialize = if no_deserialize_in_attrs(&input.attrs) {
TokenStream::new()
} else {