mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
47 lines
722 B
Rust
47 lines
722 B
Rust
#![feature(decl_macro)]
|
|
#![allow(ambiguous_glob_reexports)]
|
|
|
|
macro_rules! define_exported { () => {
|
|
#[macro_export]
|
|
macro_rules! exported {
|
|
() => ()
|
|
}
|
|
}}
|
|
macro_rules! define_panic { () => {
|
|
#[macro_export]
|
|
macro_rules! panic {
|
|
() => ()
|
|
}
|
|
}}
|
|
macro_rules! define_include { () => {
|
|
#[macro_export]
|
|
macro_rules! include {
|
|
() => ()
|
|
}
|
|
}}
|
|
|
|
use inner1::*;
|
|
|
|
mod inner1 {
|
|
pub macro exported() {}
|
|
}
|
|
|
|
exported!(); //~ ERROR `exported` is ambiguous
|
|
|
|
mod inner2 {
|
|
define_exported!();
|
|
}
|
|
|
|
fn main() {
|
|
panic!(); //~ ERROR `panic` is ambiguous
|
|
}
|
|
|
|
mod inner3 {
|
|
define_panic!();
|
|
}
|
|
|
|
mod inner4 {
|
|
define_include!();
|
|
}
|
|
|
|
include!(); //~ ERROR `include` is ambiguous
|