mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
46 lines
775 B
Rust
46 lines
775 B
Rust
// Check that macro expanded underscore imports behave as expected
|
|
|
|
// check-pass
|
|
|
|
#![feature(decl_macro, rustc_attrs)]
|
|
|
|
mod x {
|
|
pub use std::ops::Not as _;
|
|
}
|
|
|
|
macro m() {
|
|
mod w {
|
|
mod y {
|
|
pub use std::ops::Deref as _;
|
|
}
|
|
use crate::x::*;
|
|
use self::y::*;
|
|
use std::ops::DerefMut as _;
|
|
fn f() {
|
|
false.not();
|
|
(&()).deref();
|
|
(&mut ()).deref_mut();
|
|
}
|
|
}
|
|
}
|
|
|
|
#[rustc_macro_transparency = "transparent"]
|
|
macro n() {
|
|
mod z {
|
|
pub use std::ops::Deref as _;
|
|
}
|
|
use crate::x::*;
|
|
use crate::z::*;
|
|
use std::ops::DerefMut as _;
|
|
fn f() {
|
|
false.not();
|
|
(&()).deref();
|
|
(&mut ()).deref_mut();
|
|
}
|
|
}
|
|
|
|
m!();
|
|
n!();
|
|
|
|
fn main() {}
|