about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-02-10 18:37:32 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-02-10 18:37:32 +0100
commit295fd0d8352ca4cff048b29064cfafbf5f29592c (patch)
tree9f5bbb56c91a902d45c8cede35893d7f76829066 /tests
parentddb31de281d2c1edf2d09b8eb0b6f8e53a13b846 (diff)
downloadrust-295fd0d8352ca4cff048b29064cfafbf5f29592c.tar.gz
rust-295fd0d8352ca4cff048b29064cfafbf5f29592c.zip
Add regression test for reexported macros docs
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/reexport-macro.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/rustdoc/reexport-macro.rs b/tests/rustdoc/reexport-macro.rs
new file mode 100644
index 00000000000..c4dec703aed
--- /dev/null
+++ b/tests/rustdoc/reexport-macro.rs
@@ -0,0 +1,23 @@
+// Ensure that macros are correctly reexported and that they get both the comment from the
+// `pub use` and from the macro.
+
+#![crate_name = "foo"]
+
+// @has 'foo/macro.foo.html'
+// @!has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
+// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'y'
+#[macro_use]
+mod my_module {
+    /// y
+    #[macro_export]
+    macro_rules! foo {
+        () => ();
+    }
+}
+
+// @has 'foo/another_mod/macro.bar.html'
+// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
+pub mod another_mod {
+    /// x
+    pub use crate::foo as bar;
+}