Skip to content

Commit 6f3326f

Browse files
committed
auto merge of #11687 : sfackler/rust/macro-export-inner-crate, r=alexcrichton
It previously missed anything in an inner module.
2 parents 813db08 + d049c27 commit 6f3326f

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

src/librustc/metadata/encoder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,7 @@ impl<'a, 'b> Visitor<()> for MacroDefVisitor<'a, 'b> {
17201720
}
17211721
_ => {}
17221722
}
1723+
visit::walk_item(self, item, ());
17231724
}
17241725
}
17251726

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[feature(macro_rules)];
12+
13+
pub mod inner {
14+
#[macro_export]
15+
macro_rules! foo(
16+
() => (1)
17+
)
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//aux-build:macro_export_inner_module.rs
12+
//xfail-stage1
13+
//xfail-fast
14+
15+
#[feature(phase)];
16+
17+
#[phase(syntax)]
18+
extern mod macro_export_inner_module;
19+
20+
pub fn main() {
21+
assert_eq!(1, foo!());
22+
}

0 commit comments

Comments
 (0)