From eed86fac91c12707b8ef6693a5cf2106ca6652c0 Mon Sep 17 00:00:00 2001 From: Geoffry Song Date: Mon, 17 Oct 2016 21:01:36 -0700 Subject: Don't spin expanding stmt macros. If we can't make progress when parsing a macro expansion as a statement then we should just bail. This alleviates the symptoms shown in e.g. #37113 but it doesn't fix the problem that parsing invalid enum bodies (and others) leaves the parser in a crappy state. --- src/test/parse-fail/issue-37234.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/parse-fail/issue-37234.rs (limited to 'src/test') diff --git a/src/test/parse-fail/issue-37234.rs b/src/test/parse-fail/issue-37234.rs new file mode 100644 index 00000000000..651e11d9d21 --- /dev/null +++ b/src/test/parse-fail/issue-37234.rs @@ -0,0 +1,19 @@ +// 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. + +macro_rules! failed { + () => {{ + let x = 5 ""; //~ ERROR found `""` + }} //~ ERROR macro expansion ignores token `}` +} + +fn main() { + failed!(); +} -- cgit 1.4.1-3-g733a5