about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-04-10 14:22:06 -0700
committerMichael Howell <michael@notriddle.com>2021-04-10 14:22:06 -0700
commit2dfd0bfe1087fef83f26b52b32c8b54fb621b6b9 (patch)
tree8261d6dfe783f1fb810adc334d5f7428eec21e94 /src/test
parent72c63de2ccf8445bfe27dcfb4f712bc771da1b15 (diff)
downloadrust-2dfd0bfe1087fef83f26b52b32c8b54fb621b6b9.tar.gz
rust-2dfd0bfe1087fef83f26b52b32c8b54fb621b6b9.zip
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')
-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) => {}
+            }
+        }
+    }
+}