1
Fork 0

libsyntax: Stop parsing + with no bounds after it.

This will break code that looks like `Box<Trait+>`. Change that code to
`Box<Trait>` instead.

Closes #14925.

[breaking-change]
This commit is contained in:
Patrick Walton 2014-06-20 10:49:54 -07:00
parent 6750eb5a05
commit ae067477fb
9 changed files with 33 additions and 14 deletions

View file

@ -1646,6 +1646,12 @@ impl<'a> Parser<'a> {
let bounds = {
if self.eat(&token::BINOP(token::PLUS)) {
let (_, bounds) = self.parse_ty_param_bounds(false);
if bounds.len() == 0 {
let last_span = self.last_span;
self.span_err(last_span,
"at least one type parameter bound \
must be specified after the `+`");
}
Some(bounds)
} else {
None