aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-01-21 11:06:50 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-01-21 11:06:50 +0100
commita69d0609e994657392a8ebcac72c038669f75ea9 (patch)
tree84164ab701674d0b5166d6a3c981483ff9e66aec
parentfb3de4ce6db9e85ed1ece18d614df47e55ea3c27 (diff)
downloadaskama-a69d0609e994657392a8ebcac72c038669f75ea9.tar.gz
askama-a69d0609e994657392a8ebcac72c038669f75ea9.tar.bz2
askama-a69d0609e994657392a8ebcac72c038669f75ea9.zip
Don't copy trait parameters to type generics (fixes #65)
-rw-r--r--askama_shared/src/generator.rs5
1 files changed, 3 insertions, 2 deletions
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(),
);
}