about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-05-03 19:09:08 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-05-03 19:54:55 +0530
commit51a3a8f5230e6c77b4ecea397742fcf51ff5b749 (patch)
tree34be84c4cee50019376c004b91f340e2546f277f
parent52c97f237b7cf79889136569cec014f0fdd4af98 (diff)
parent98d991fac531d9a437a697dc7ad29967c978a3d3 (diff)
downloadrust-51a3a8f5230e6c77b4ecea397742fcf51ff5b749.tar.gz
rust-51a3a8f5230e6c77b4ecea397742fcf51ff5b749.zip
Rollup merge of #33343 - birkenfeld:issue-32214, r=Manishearth
parser: change warning into an error on `T<A=B, C>`

part of #32214

This seems to be the obvious fix, and the error message is consistent with all the other parser errors ("expected x, found y").
-rw-r--r--src/libsyntax/parse/parser.rs6
-rw-r--r--src/test/parse-fail/issue-32214.rs17
2 files changed, 18 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b9188f5101d..9cd2e6ef7d6 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4419,11 +4419,7 @@ impl<'a> Parser<'a> {
                 p.forbid_lifetime()?;
                 let lo = p.span.lo;
                 let ident = p.parse_ident()?;
-                let found_eq = p.eat(&token::Eq);
-                if !found_eq {
-                    let span = p.span;
-                    p.span_warn(span, "whoops, no =?");
-                }
+                p.expect(&token::Eq)?;
                 let ty = p.parse_ty()?;
                 let hi = ty.span.hi;
                 let span = mk_sp(lo, hi);
diff --git a/src/test/parse-fail/issue-32214.rs b/src/test/parse-fail/issue-32214.rs
new file mode 100644
index 00000000000..3ba59c8ee94
--- /dev/null
+++ b/src/test/parse-fail/issue-32214.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
+pub fn test<W, I: Iterator<Item=(), W> >() {
+    //~^ ERROR expected `=`, found `>`
+}
+
+fn main() { }