Add support for multiple region bounds in where clauses

This commit is contained in:
Jared Roesch
2014-12-20 02:48:43 -08:00
parent e0cac488ac
commit d87b308b67
11 changed files with 79 additions and 24 deletions

View File

@@ -2444,11 +2444,18 @@ impl<'a> State<'a> {
try!(self.print_bounds(":", bounds.as_slice()));
}
&ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
ref bound,
ref bounds,
..}) => {
try!(self.print_lifetime(lifetime));
try!(word(&mut self.s, ":"));
try!(self.print_lifetime(bound));
for (i, bound) in bounds.iter().enumerate() {
try!(self.print_lifetime(bound));
if i != 0 {
try!(word(&mut self.s, ":"));
}
}
}
&ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => {
try!(self.print_path(path, false));