This error message is exactly what it says on the tin.
mod module {
// okay; it's an empty glob
pub use self::a::*;
mod a {
fn foo() {}
}
// ERROR: A non-empty glob must import something with the glob's visibility
pub use self::b::*;
mod b {
fn foo() {}
pub(super) fn bar() {}
}
// okay: there's a pub item
pub use self::c::*;
mod c {
fn foo() {}
pub(super) fn bar() {}
pub fn baz() {}
}
}
Is it just me or does this seem like, really arbitrary?
Encountered while trying to make a wrapper around a proc-macro-hack
item macro that lets it be used multiple times.
#[macro_export]
macro_rules! unbox {
(
#![unbox(unique_id($unique_id:ident))]
$($tt:tt)*
) => {
// re-export whatever the user defines with the same visibility
#[allow(unused)]
pub use self::$unique_id::*;
mod $unique_id {
#[allow(unused)]
use super::*;
unbox_hack!{ $($tt)* }
// HACK for "error: A non-empty glob must import something
// with the glob's visibility" in case the user didn't define
// anything that is `pub`
#[doc(hidden)]
#[allow(non_snake_case)]
pub fn __a_thing_that_is_pub() { }
}
};
}