]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/macro_rules-matchers.rs
rustdoc: Early doc link resolution fixes and refactorings
[rust.git] / src / test / rustdoc / macro_rules-matchers.rs
1 // This is a regression test for issue #86208.
2 // It is also a general test of macro_rules! display.
3
4 #![crate_name = "foo"]
5
6 // @has 'foo/macro.todo.html'
7 // @has - '//span[@class="macro"]' 'macro_rules!'
8 // @has - '//span[@class="ident"]' 'todo'
9 // Note: the only op is the `+`
10 // @count - '//pre[@class="rust macro"]//span[@class="op"]' 1
11
12 // @has - '{ () => { ... }; ($('
13 // @has - '//span[@class="macro-nonterminal"]' '$'
14 // @has - '//span[@class="macro-nonterminal"]' 'arg'
15 // @has - ':'
16 // @has - '//span[@class="ident"]' 'tt'
17 // @has - '),'
18 // @has - '//span[@class="op"]' '+'
19 // @has - ') => { ... }; }'
20 pub use std::todo;
21
22 mod mod1 {
23     // @has 'foo/macro.macro1.html'
24     // @has - 'macro_rules!'
25     // @has - 'macro1'
26     // @has - '{ () => { ... }; ($('
27     // @has - '//span[@class="macro-nonterminal"]' '$'
28     // @has - '//span[@class="macro-nonterminal"]' 'arg'
29     // @has - ':'
30     // @has - 'expr'
31     // @has - '),'
32     // @has - '+'
33     // @has - ') => { ... }; }'
34     #[macro_export]
35     macro_rules! macro1 {
36         () => {};
37         ($($arg:expr),+) => { stringify!($($arg),+) };
38     }
39 }