about summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
authorJared Roesch <roeschinc@gmail.com>2014-12-20 02:29:19 -0800
committerJared Roesch <roeschinc@gmail.com>2014-12-20 02:48:17 -0800
commite0cac488ac6ca16507da390429565b7879f76bb4 (patch)
tree04e303a6337ac139698b9eecee0e2f52418d04d2 /src/libsyntax/print/pprust.rs
parent8f51ad2420776925c12be67a7bf38ac28343fd1f (diff)
downloadrust-e0cac488ac6ca16507da390429565b7879f76bb4.tar.gz
rust-e0cac488ac6ca16507da390429565b7879f76bb4.zip
Add parser support for generalized where clauses
Implement support in the parser for generalized where clauses,
as well as the conversion of ast::WherePredicates to
ty::Predicate in `collect.rs`.
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index d2cc0cba317..d619a386664 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -2437,12 +2437,19 @@ impl<'a> State<'a> {
             }
 
             match predicate {
-                &ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate{ident,
+                &ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate{ref bounded_ty,
                                                                               ref bounds,
                                                                               ..}) => {
-                    try!(self.print_ident(ident));
+                    try!(self.print_type(&**bounded_ty));
                     try!(self.print_bounds(":", bounds.as_slice()));
                 }
+                &ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
+                                                                                ref bound,
+                                                                                ..}) => {
+                    try!(self.print_lifetime(lifetime));
+                    try!(word(&mut self.s, ":"));
+                    try!(self.print_lifetime(bound));
+                }
                 &ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => {
                     try!(self.print_path(path, false));
                     try!(space(&mut self.s));