From ae067477fbc08e5998756d36b6ab0b82173e5c74 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 20 Jun 2014 10:49:54 -0700 Subject: libsyntax: Stop parsing `+` with no bounds after it. This will break code that looks like `Box`. Change that code to `Box` instead. Closes #14925. [breaking-change] --- src/libsyntax/parse/parser.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ae2ec216bee..158a8c5a116 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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 -- cgit 1.4.1-3-g733a5