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