about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-01 19:37:18 +0000
committerbors <bors@rust-lang.org>2014-10-01 19:37:18 +0000
commitb224dfe1a6ff1b392fd68004cf7a0a04dfec9975 (patch)
treea115ee9e497c004b592a7107e44aa57e1db1f14c /src/test
parent49fcb27df63b845c42d4883c47d2cfc512edeb78 (diff)
parent49e976d771d9a3282bb0f58f28e5e92d10c2e4c6 (diff)
downloadrust-b224dfe1a6ff1b392fd68004cf7a0a04dfec9975.tar.gz
rust-b224dfe1a6ff1b392fd68004cf7a0a04dfec9975.zip
auto merge of #17678 : fhahn/rust/issue-17628-infinite-recursion, r=alexcrichton
This is a patch for #17628, thanks to @kmcallister for your helpful hints!
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/infinite-macro-expansion.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/compile-fail/infinite-macro-expansion.rs b/src/test/compile-fail/infinite-macro-expansion.rs
new file mode 100644
index 00000000000..3ea5671735d
--- /dev/null
+++ b/src/test/compile-fail/infinite-macro-expansion.rs
@@ -0,0 +1,22 @@
+// Copyright 2014 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.
+
+#![feature(macro_rules)]
+
+macro_rules! recursive(
+      () => (
+                recursive!() //~ ERROR Recursion limit reached while expanding the macro `recursive`
+              )
+      )
+
+fn main() {
+    recursive!()
+}
+