about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-21 15:36:39 +0000
committerbors <bors@rust-lang.org>2014-06-21 15:36:39 +0000
commitf556c8cbd8af182a9dd871a4a36692a0dba7cc2e (patch)
treeff327e3fd249e8d4b9fa9f0985e78f34592a3310 /src/libsyntax/parse/parser.rs
parent0ae4b97c09a5b5c230f5dee9bdcef85951b6e00d (diff)
parentae067477fbc08e5998756d36b6ab0b82173e5c74 (diff)
downloadrust-f556c8cbd8af182a9dd871a4a36692a0dba7cc2e.tar.gz
rust-f556c8cbd8af182a9dd871a4a36692a0dba7cc2e.zip
auto merge of #15062 : pcwalton/rust/trailing-plus, r=brson
This will break code that looks like `Box<Trait+>`. Change that code to
`Box<Trait>` instead.

Closes #14925.

[breaking-change]

r? @brson
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b56919c53c7..043ce3bf5b0 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1658,6 +1658,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