Closed
Description
#![feature(macro_rules)]
macro_rules! priv_x( () => (
static x: uint = 0;
))
macro_rules! pub_x( () => (
pub priv_x!()
))
mod foo {
pub_x!()
}
fn main() {
let y: uint = foo::x;
}
expands to
// ...
mod foo {
use std::prelude::*;
static x: uint = 0;
}
fn main() { let y: uint = foo::x; }
and fails with
foo.rs:16:19: 16:25 error: static `x` is private
foo.rs:16 let y: uint = foo::x;
^~~~~~
This isn't a hygeine issue; a macro which expands directly to pub static x: uint = 0;
works fine.
rustc 0.11.0-pre (ef9bf3a 2014-06-04 13:06:47 -0700)
host: x86_64-unknown-linux-gnu