summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-05-06 22:39:43 -0700
committerbors <bors@rust-lang.org>2016-05-06 22:39:43 -0700
commit6478583cdb57aea8d2b9ceb25dfe5ba60a7083a3 (patch)
tree7e8175cbf2dbf219f71c27543bb5b781a71f05e6 /src/test/parse-fail
parentc95cda56a6b515e8a1117db0648058f892339821 (diff)
parenta36fb461addccb41d9a0cb75857efa41a9f2681e (diff)
downloadrust-6478583cdb57aea8d2b9ceb25dfe5ba60a7083a3.tar.gz
rust-6478583cdb57aea8d2b9ceb25dfe5ba60a7083a3.zip
Auto merge of #33311 - birkenfeld:issue33262, r=nrc
parser: fix suppression of syntax errors in range RHS

Invalid expressions on the RHS were just swallowed without generating an error.  The new version more closely mirrors the code for parsing `..x` in the `parse_prefix_range_expr` method below, where no cancel is done either.

Fixes #33262.
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/issue-33262.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/parse-fail/issue-33262.rs b/src/test/parse-fail/issue-33262.rs
new file mode 100644
index 00000000000..d6bbfdc59f5
--- /dev/null
+++ b/src/test/parse-fail/issue-33262.rs
@@ -0,0 +1,18 @@
+// 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
+
+// Issue #33262
+
+pub fn main() {
+    for i in 0..a as { }
+    //~^ ERROR expected type, found `{`
+}