From 2dfd0bfe1087fef83f26b52b32c8b54fb621b6b9 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 10 Apr 2021 14:22:06 -0700 Subject: rustdoc: clean up and test macro visibility print This fixes the overly-complex invariant mentioned in , where the macro source can't have any links in it only because the cache hasn't been populated yet. --- src/test/rustdoc/decl_macro.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test/rustdoc') 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) => {} + } + } + } +} -- cgit 1.4.1-3-g733a5