2021-01-06 20:50:02 +00:00
|
|
|
// Make sure that underscore imports have the same hygiene considerations as other imports.
|
|
|
|
|
|
|
|
// check-pass
|
2019-09-07 20:22:36 +00:00
|
|
|
|
|
|
|
#![feature(decl_macro)]
|
|
|
|
|
|
|
|
mod x {
|
|
|
|
pub use std::ops::Deref as _;
|
|
|
|
}
|
|
|
|
|
|
|
|
macro glob_import() {
|
|
|
|
pub use crate::x::*;
|
|
|
|
}
|
|
|
|
|
|
|
|
macro underscore_import() {
|
|
|
|
use std::ops::DerefMut as _;
|
|
|
|
}
|
|
|
|
|
|
|
|
mod y {
|
|
|
|
crate::glob_import!();
|
|
|
|
crate::underscore_import!();
|
|
|
|
}
|
|
|
|
|
|
|
|
macro create_module($y:ident) {
|
|
|
|
mod $y {
|
|
|
|
crate::glob_import!();
|
|
|
|
crate::underscore_import!();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
create_module!(z);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
use crate::y::*;
|
|
|
|
use crate::z::*;
|
|
|
|
glob_import!();
|
|
|
|
underscore_import!();
|
2021-01-06 20:50:02 +00:00
|
|
|
(&()).deref();
|
|
|
|
(&mut ()).deref_mut();
|
2019-09-07 20:22:36 +00:00
|
|
|
}
|