rust/tests/ui/underscore-imports/macro-expanded.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
775 B
Rust
Raw Normal View History

2019-09-07 15:22:36 -05:00
// 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() {}