From a69d0609e994657392a8ebcac72c038669f75ea9 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 21 Jan 2018 11:06:50 +0100 Subject: Don't copy trait parameters to type generics (fixes #65) --- askama_shared/src/generator.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'askama_shared/src/generator.rs') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index e173c45..ac2f4be 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -287,7 +287,8 @@ impl<'a> Generator<'a> { for v in vars.iter() { generics.params.push(parse_quote!(#v)); } - let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); + let (_, orig_ty_generics, _) = state.input.ast.generics.split_for_impl(); + let (impl_generics, _, where_clause) = generics.split_for_impl(); let ident = state.input.ast.ident.as_ref(); self.writeln( format!( @@ -295,7 +296,7 @@ impl<'a> Generator<'a> { quote!(impl#impl_generics), target, ident, - quote!(#ty_generics #where_clause), + quote!(#orig_ty_generics #where_clause), ).as_ref(), ); } -- cgit