about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2015-01-22 23:05:02 -0800
committerVadim Chugunov <vadimcn@gmail.com>2015-01-22 23:05:02 -0800
commit5c344d3ea8f590739af7ea8b35028a64baf8b296 (patch)
tree11aa99ca822e001471b62c8a60414e16d24fa9d1
parent27a261be3ee99664c1f05eb1a17ec9e384da6d7b (diff)
Added test.
-rw-r--r--src/test/auxiliary/macro_with_super_1.rs26
-rw-r--r--src/test/run-pass/macro_with_super_2.rs20
2 files changed, 46 insertions, 0 deletions
diff --git a/src/test/auxiliary/macro_with_super_1.rs b/src/test/auxiliary/macro_with_super_1.rs
new file mode 100644
index 00000000000..ac50be06ef7
--- /dev/null
+++ b/src/test/auxiliary/macro_with_super_1.rs
@@ -0,0 +1,26 @@
+// Copyright 2015 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.
+
+#![crate_type = "lib"]
+
+#[macro_export]
+macro_rules! declare { 
+    () => (
+        pub fn aaa() {}
+
+        pub mod bbb {
+            use super::aaa;
+
+            pub fn ccc() {
+                aaa();
+            }
+        }
+    )
+}
diff --git a/src/test/run-pass/macro_with_super_2.rs b/src/test/run-pass/macro_with_super_2.rs
new file mode 100644
index 00000000000..5c681b8e6e7
--- /dev/null
+++ b/src/test/run-pass/macro_with_super_2.rs
@@ -0,0 +1,20 @@
+// Copyright 2015 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.
+
+// aux-build:macro_with_super_1.rs
+
+#[macro_use]
+extern crate macro_with_super_1;
+
+declare!();
+
+fn main() {
+    bbb::ccc();
+}