rust/src/test/ui/macros/macro-use-scope.rs

23 lines
415 B
Rust
Raw Normal View History

2016-06-12 04:24:51 +00:00
// aux-build:two_macros.rs
// compile-pass
2016-06-12 04:24:51 +00:00
#![allow(unused)]
fn f() {
let _ = macro_one!();
2016-06-02 02:24:49 +00:00
}
2016-06-12 04:24:51 +00:00
#[macro_use(macro_one)] // Check that this macro is usable in the above function
extern crate two_macros;
2016-10-11 05:13:40 +00:00
fn g() {
macro_two!();
}
2016-06-12 04:24:51 +00:00
macro_rules! m { () => {
#[macro_use(macro_two)] // Check that this macro is usable in the above function
extern crate two_macros as _two_macros;
} }
2016-06-02 02:24:49 +00:00
m!();
fn main() {}