From 98d991fac531d9a437a697dc7ad29967c978a3d3 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 2 May 2016 15:09:36 +0200 Subject: [PATCH] parser: change warning into an error on `T` Fixes: #32214 --- src/libsyntax/parse/parser.rs | 6 +----- src/test/parse-fail/issue-32214.rs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 src/test/parse-fail/issue-32214.rs diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 671a11b57dec1..e5780c706081e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4420,11 +4420,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 0000000000000..3ba59c8ee946b --- /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 or the MIT license +// , 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 >() { + //~^ ERROR expected `=`, found `>` +} + +fn main() { }