2015-02-12 22:43:57 -06:00
|
|
|
// Issue #14660
|
|
|
|
|
2020-01-31 23:18:10 -06:00
|
|
|
macro_rules! priv_x {
|
|
|
|
() => {
|
|
|
|
static x: u32 = 0;
|
|
|
|
};
|
|
|
|
}
|
2015-02-12 22:43:57 -06:00
|
|
|
|
|
|
|
macro_rules! pub_x { () => {
|
|
|
|
pub priv_x!(); //~ ERROR can't qualify macro invocation with `pub`
|
2020-01-31 23:18:10 -06:00
|
|
|
//~^ HELP remove the visibility
|
|
|
|
//~| HELP try adjusting the macro to put `pub` inside the invocation
|
2015-02-12 22:43:57 -06:00
|
|
|
}}
|
|
|
|
|
|
|
|
mod foo {
|
|
|
|
pub_x!();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-12-16 11:23:27 -06:00
|
|
|
let y: u32 = foo::x; //~ ERROR static `x` is private
|
2015-02-12 22:43:57 -06:00
|
|
|
}
|