Parse where-clause on associated types
diff --git a/src/item.rs b/src/item.rs
index 3f1ad79..2dfb75d 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -1500,6 +1500,7 @@
type_: keyword!(type) >>
ident: syn!(Ident) >>
generics: syn!(Generics) >>
+ where_clause: option!(syn!(WhereClause)) >>
eq: punct!(=) >>
ty: syn!(Type) >>
semi: punct!(;) >>
@@ -1509,7 +1510,10 @@
defaultness: defaultness,
type_token: type_,
ident: ident,
- generics: generics,
+ generics: Generics {
+ where_clause: where_clause,
+ ..generics
+ },
eq_token: eq,
ty: ty,
semi_token: semi,
@@ -1925,6 +1929,7 @@
self.type_token.to_tokens(tokens);
self.ident.to_tokens(tokens);
self.generics.to_tokens(tokens);
+ self.generics.where_clause.to_tokens(tokens);
self.eq_token.to_tokens(tokens);
self.ty.to_tokens(tokens);
self.semi_token.to_tokens(tokens);
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index d0bb86c..cc2a810 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -116,10 +116,6 @@
//
// https://github.com/dtolnay/syn/issues/454
"tests/rust/src/test/run-pass/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs" |
- // TODO where-clause on associated types
- //
- // https://github.com/dtolnay/syn/issues/453
- "tests/rust/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.rs" |
// Deprecated placement syntax
"tests/rust/src/test/run-pass/new-box-syntax.rs" |
"tests/rust/src/test/ui/obsolete-in-place/bad.rs" |