mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
33 lines
506 B
Rust
33 lines
506 B
Rust
// check-pass
|
|
// edition:2018
|
|
// compile-flags: -Z span-debug
|
|
// aux-build:test-macros.rs
|
|
|
|
#![no_std] // Don't load unnecessary hygiene information from std
|
|
extern crate std;
|
|
|
|
#[macro_use] extern crate test_macros;
|
|
|
|
macro_rules! foo {(
|
|
#[fake_attr]
|
|
$item:item
|
|
) => (
|
|
$item
|
|
)}
|
|
|
|
macro_rules! outer {($item:item) => (
|
|
print_bang! { // Identity proc-macro
|
|
foo! {
|
|
#[fake_attr]
|
|
$item
|
|
}
|
|
}
|
|
)}
|
|
outer! {
|
|
mod bar {
|
|
//! Foo
|
|
}
|
|
}
|
|
|
|
fn main() {}
|