about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-03-25 04:04:13 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-03-25 04:04:13 +0000
commit29a052d2d807dcb9f1d45878a3083af7a993263d (patch)
tree0567e1792355119542aee719811e6b273eba6fd6 /src/test
parent49c67bd632e961a57863805e5d0a400f97da9b93 (diff)
downloadrust-29a052d2d807dcb9f1d45878a3083af7a993263d.tar.gz
rust-29a052d2d807dcb9f1d45878a3083af7a993263d.zip
Fix ICE with nested macros in certain situations.
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!());
+}