diff options
| author | David Tolnay <dtolnay@gmail.com> | 2022-01-08 12:39:47 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2022-01-18 11:04:00 -0800 |
| commit | d950c1b2000371253e026281cbfac30857b04470 (patch) | |
| tree | f3b6e45d4bf1a545023885d0f729ffe7bec2d3a7 | |
| parent | 9ad5d82f822b3cb67637f11be2e65c5662b66ec0 (diff) | |
| download | rust-d950c1b2000371253e026281cbfac30857b04470.tar.gz rust-d950c1b2000371253e026281cbfac30857b04470.zip | |
Extend rustdoc macro-generated-macro test
| -rw-r--r-- | src/test/rustdoc/macro-generated-macro.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/test/rustdoc/macro-generated-macro.rs b/src/test/rustdoc/macro-generated-macro.rs index 25d8bc3ec62..942d8afaa50 100644 --- a/src/test/rustdoc/macro-generated-macro.rs +++ b/src/test/rustdoc/macro-generated-macro.rs @@ -1,14 +1,21 @@ -macro_rules! outer { - ($($matcher:tt)*) => { +macro_rules! make_macro { + ($macro_name:ident $($matcher:tt)*) => { #[macro_export] - macro_rules! inner { + macro_rules! $macro_name { (<= $($matcher)* =>) => {}; } } } -// @has macro_generated_macro/macro.inner.html //pre 'macro_rules! inner {' +// @has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {' // @has - //pre '(<= type $($i : ident) :: * + $e : expr =>) => { ... };' -outer!(type $($i:ident)::* + $e:expr); +make_macro!(interpolations type $($i:ident)::* + $e:expr); +interpolations!(<= type foo::bar + x.sort() =>); -inner!(<= type foo::bar + x.sort() =>); +// @has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {' +// @has - //pre '(<= #! [no_std] #[inline] =>) => { ... };' +make_macro!(attributes #![no_std] #[inline]); + +// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {' +// @has - //pre '(<= fn {} () { foo [0] } =>) => { ... };' +make_macro!(groups fn {}() {foo[0]}); |
