Files
rust/src/test/rustdoc/macro_rules-matchers.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
998 B
Rust
Raw Normal View History

// This is a regression test for issue #86208.
// It is also a general test of macro_rules! display.
#![crate_name = "foo"]
// @has 'foo/macro.todo.html'
// @has - '//span[@class="macro"]' 'macro_rules!'
// @has - '//span[@class="ident"]' 'todo'
2021-10-04 18:19:58 -07:00
// @has - '{ () => { ... }; ($('
// @has - '//span[@class="macro-nonterminal"]' '$'
// @has - '//span[@class="macro-nonterminal"]' 'arg'
// @has - ':'
// @has - '//span[@class="ident"]' 'tt'
// @has - ')+'
2021-10-04 18:19:58 -07:00
// @has - ') => { ... }; }'
pub use std::todo;
mod mod1 {
// @has 'foo/macro.macro1.html'
// @has - 'macro_rules!'
// @has - 'macro1'
2021-10-04 18:19:58 -07:00
// @has - '{ () => { ... }; ($('
// @has - '//span[@class="macro-nonterminal"]' '$'
// @has - '//span[@class="macro-nonterminal"]' 'arg'
// @has - ':'
// @has - 'expr'
// @has - '),'
// @has - '+'
2021-10-04 18:19:58 -07:00
// @has - ') => { ... }; }'
#[macro_export]
macro_rules! macro1 {
() => {};
($($arg:expr),+) => { stringify!($($arg),+) };
}
}