diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/rustdoc/decl_macro.rs | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/rustdoc/decl_macro.rs')
-rw-r--r-- | src/test/rustdoc/decl_macro.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/test/rustdoc/decl_macro.rs b/src/test/rustdoc/decl_macro.rs new file mode 100644 index 000000000..94ade31b5 --- /dev/null +++ b/src/test/rustdoc/decl_macro.rs @@ -0,0 +1,56 @@ +// compile-flags: --document-private-items + +#![feature(decl_macro)] + +// @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {' +// @has - //pre '...' +// @has - //pre '}' +pub macro my_macro() { + +} + +// @has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {' +// @has - //pre '...' +// @has - //pre '}' +pub macro my_macro_2($($tok:tt)*) { + +} + +// @has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {' +// @has - //pre '(_) => { ... },' +// @has - //pre '($foo:ident . $bar:expr) => { ... },' +// @has - //pre '($($foo:literal),+) => { ... },' +// @has - //pre '}' +pub macro my_macro_multi { + (_) => { + + }, + ($foo:ident . $bar:expr) => { + + }, + ($($foo:literal),+) => { + + } +} + +// @has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {' +// @has - //pre '...' +// @has - //pre '}' +pub macro by_example_single { + ($foo:expr) => {} +} + +mod a { + mod b { + // @has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {' + pub(in super) macro by_example_vis { + ($foo:expr) => {} + } + mod c { + // @has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {' + pub(in a) macro by_example_vis_named { + ($foo:expr) => {} + } + } + } +} |