Skip to content

Commit 51a3a8f

Browse files
committed
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").
2 parents 52c97f2 + 98d991f commit 51a3a8f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/libsyntax/parse/parser.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -4419,11 +4419,7 @@ impl<'a> Parser<'a> {
44194419
p.forbid_lifetime()?;
44204420
let lo = p.span.lo;
44214421
let ident = p.parse_ident()?;
4422-
let found_eq = p.eat(&token::Eq);
4423-
if !found_eq {
4424-
let span = p.span;
4425-
p.span_warn(span, "whoops, no =?");
4426-
}
4422+
p.expect(&token::Eq)?;
44274423
let ty = p.parse_ty()?;
44284424
let hi = ty.span.hi;
44294425
let span = mk_sp(lo, hi);

src/test/parse-fail/issue-32214.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -Z parse-only -Z continue-parse-after-error
12+
13+
pub fn test<W, I: Iterator<Item=(), W> >() {
14+
//~^ ERROR expected `=`, found `>`
15+
}
16+
17+
fn main() { }

0 commit comments

Comments
 (0)