about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-16 23:41:43 +0000
committerbors <bors@rust-lang.org>2021-04-16 23:41:43 +0000
commit84e93979e1b7fd7f786a8f92ca5bdd92f2be25e7 (patch)
treec3de2a820a1d572cbb2635e66f43f171a343cce5 /src/test/rustdoc
parentb0c818c5e0fa37251d9fda2f656bf1041a2e1e1d (diff)
parent2dfd0bfe1087fef83f26b52b32c8b54fb621b6b9 (diff)
downloadrust-84e93979e1b7fd7f786a8f92ca5bdd92f2be25e7.tar.gz
rust-84e93979e1b7fd7f786a8f92ca5bdd92f2be25e7.zip
Auto merge of #84074 - notriddle:rustdoc-macro-visibility, r=jyn514
rustdoc: clean up and test macro visibility print

This fixes the overly-complex invariant mentioned in <https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570>, where the macro source can't have any links in it only because the cache hasn't been populated yet.
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/decl_macro.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/rustdoc/decl_macro.rs b/src/test/rustdoc/decl_macro.rs
index e48a56f906c..ede3f455a20 100644
--- a/src/test/rustdoc/decl_macro.rs
+++ b/src/test/rustdoc/decl_macro.rs
@@ -1,3 +1,5 @@
+// compile-flags: --document-private-items
+
 #![feature(decl_macro)]
 
 // @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {'
@@ -37,3 +39,18 @@ pub macro my_macro_multi {
 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) => {}
+            }
+        }
+    }
+}