mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
23 lines
622 B
Rust
23 lines
622 B
Rust
// Test for the `macro_attr` and `macro_derive` features.
|
|
|
|
#![feature(macro_derive)]
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
//@ has 'foo/index.html'
|
|
//@ count - '//*[@id="main-content"]/h2[@class="section-header"]' 1
|
|
//@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Derive Macros'
|
|
//@ has - '//a[@href="derive.derive.html"]' 'derive'
|
|
|
|
//@ has 'foo/derive.derive.html'
|
|
//@ has - '//*[@class="rust item-decl"]/code' '#[derive(derive)]'
|
|
|
|
//@ has 'foo/all.html'
|
|
//@ count - '//*[@id="main-content"]/h3' 1
|
|
//@ has - '//*[@id="main-content"]/h3' 'Derive Macros'
|
|
|
|
#[macro_export]
|
|
macro_rules! derive {
|
|
derive() () => {};
|
|
}
|