From 5c344d3ea8f590739af7ea8b35028a64baf8b296 Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Thu, 22 Jan 2015 23:05:02 -0800 Subject: [PATCH] Added test. --- src/test/auxiliary/macro_with_super_1.rs | 26 ++++++++++++++++++++++++ src/test/run-pass/macro_with_super_2.rs | 20 ++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/test/auxiliary/macro_with_super_1.rs create mode 100644 src/test/run-pass/macro_with_super_2.rs 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 or the MIT license +// , 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 or the MIT license +// , 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(); +}