libsyntax: Implement the + syntax for multiple trait bounds. r=tjc
This commit is contained in:
@@ -2531,6 +2531,10 @@ impl Parser {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if self.eat(token::BINOP(token::PLUS)) {
|
||||
// Should be `break;` but that isn't backwards compatible.
|
||||
}
|
||||
}
|
||||
}
|
||||
return @move bounds;
|
||||
|
||||
@@ -1791,8 +1791,15 @@ fn print_arg_mode(s: ps, m: ast::mode) {
|
||||
fn print_bounds(s: ps, bounds: @~[ast::ty_param_bound]) {
|
||||
if bounds.is_not_empty() {
|
||||
word(s.s, ~":");
|
||||
let mut first = true;
|
||||
for vec::each(*bounds) |&bound| {
|
||||
nbsp(s);
|
||||
if first {
|
||||
first = false;
|
||||
} else {
|
||||
word_space(s, ~"+");
|
||||
}
|
||||
|
||||
match bound {
|
||||
TraitTyParamBound(ty) => print_type(s, ty),
|
||||
RegionTyParamBound => word(s.s, ~"&static"),
|
||||
|
||||
Reference in New Issue
Block a user