Remove type parameter defaults from impls (fixes #12)

This commit is contained in:
Dirkjan Ochtman 2017-03-08 20:14:55 +01:00
parent 9397378e4e
commit ed89e5f027
2 changed files with 5 additions and 2 deletions

View File

@ -334,7 +334,9 @@ impl<'a> Generator<'a> {
full_anno.append(","); full_anno.append(",");
orig_anno.append(","); orig_anno.append(",");
} }
param.to_tokens(&mut full_anno); let mut impl_param = param.clone();
impl_param.default = None;
impl_param.to_tokens(&mut full_anno);
param.ident.to_tokens(&mut orig_anno); param.ident.to_tokens(&mut orig_anno);
sep = true; sep = true;
} }

View File

@ -110,7 +110,8 @@ fn test_option() {
#[derive(Template)] #[derive(Template)]
#[template(path = "generics.html")] #[template(path = "generics.html")]
struct GenericsTemplate<T: std::fmt::Display, U> where U: std::fmt::Display { struct GenericsTemplate<T: std::fmt::Display, U = u8>
where U: std::fmt::Display {
t: T, t: T,
u: U, u: U,
} }