From 7d340942a0c77ab4c59575273bfa555642a6b5e2 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 26 Nov 2019 22:36:58 +0100 Subject: [PATCH] Error when derive(Outgoing) is used on a type with generics --- ruma-api-macros/src/derive_outgoing.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruma-api-macros/src/derive_outgoing.rs b/ruma-api-macros/src/derive_outgoing.rs index 8d8e866b..aec49740 100644 --- a/ruma-api-macros/src/derive_outgoing.rs +++ b/ruma-api-macros/src/derive_outgoing.rs @@ -12,6 +12,13 @@ mod wrap_incoming; use wrap_incoming::Meta; pub fn expand_derive_outgoing(input: DeriveInput) -> syn::Result { + 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 {