mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
35 lines
578 B
Rust
35 lines
578 B
Rust
// Make sure that underscore imports with different contexts can exist in the
|
|
// same scope.
|
|
|
|
//@ check-pass
|
|
|
|
#![feature(decl_macro)]
|
|
|
|
mod x {
|
|
pub use std::ops::Deref as _;
|
|
}
|
|
|
|
macro n() {
|
|
pub use crate::x::*;
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! p {
|
|
() => { pub use crate::x::*; }
|
|
}
|
|
|
|
macro m($y:ident) {
|
|
mod $y {
|
|
crate::n!(); // Reexport of `Deref` should not be imported in `main`
|
|
crate::p!(); // Reexport of `Deref` should be imported into `main`
|
|
}
|
|
}
|
|
|
|
m!(y);
|
|
|
|
fn main() {
|
|
use crate::y::*;
|
|
#[allow(noop_method_call)]
|
|
(&()).deref();
|
|
}
|