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:
parent
6750eb5a05
commit
ae067477fb
9 changed files with 33 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue