about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-05 04:54:21 +0000
committerbors <bors@rust-lang.org>2023-06-05 04:54:21 +0000
commit51f714c8c5021fe25442e46798b1cbef2f2249ed (patch)
tree0cc8d5cbe38339e9386a2358692ab62156c8729b /src
parente4106065bf1bb515935d5d024e8d9c86454e2b22 (diff)
parent16749d1d999c03014b2fd5d646675c3f6f55afac (diff)
Auto merge of #110945 - wackbyte:doc-vis-on-inherent-assoc-types, r=jsha
rustdoc: render visibility on associated types

This should only affect inherent associated types (#8995).
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index a5223bd6309..4e7c0838f5a 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -787,10 +787,12 @@ fn assoc_type(
     indent: usize,
     cx: &Context<'_>,
 ) {
+    let tcx = cx.tcx();
     write!(
         w,
-        "{indent}type <a{href} class=\"associatedtype\">{name}</a>{generics}",
+        "{indent}{vis}type <a{href} class=\"associatedtype\">{name}</a>{generics}",
         indent = " ".repeat(indent),
+        vis = visibility_print_with_space(it.visibility(tcx), it.item_id, cx),
         href = assoc_href_attr(it, link, cx),
         name = it.name.as_ref().unwrap(),
         generics = generics.print(cx),