about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-03-27 15:24:19 -0500
committerAlex Crichton <alex@alexcrichton.com>2017-03-27 15:56:24 -0700
commit1fe2dfca813a2e95e4e842333a87a207db20bb6e (patch)
tree3c10e1c5aa057e9fd9f0d0356500193d4a4d1f4f /src/test
parentbccd341d11f51cb0c06d60a318b0f7decad0a795 (diff)
parent29a052d2d807dcb9f1d45878a3083af7a993263d (diff)
downloadrust-1fe2dfca813a2e95e4e842333a87a207db20bb6e.tar.gz
rust-1fe2dfca813a2e95e4e842333a87a207db20bb6e.zip
Rollup merge of #40813 - jseyfried:fix_expansion_regression, r=nrc
macros: fix ICE on some nested macro definitions

Fixes #40770.
r? @nrc
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-40770.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-40770.rs b/src/test/run-pass/issue-40770.rs
new file mode 100644
index 00000000000..599d0b273e3
--- /dev/null
+++ b/src/test/run-pass/issue-40770.rs
@@ -0,0 +1,19 @@
+// Copyright 2017 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.
+
+macro_rules! m {
+    ($e:expr) => {
+        macro_rules! n { () => { $e } }
+    }
+}
+
+fn main() {
+    m!(foo!());
+}