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`.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user