about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-01-25 17:09:18 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-01-25 17:09:48 +0100
commitd442a372621f70bd63f42917becf184387cfe3d4 (patch)
tree2bb5612a85868c626e192114819919ddb0b8fb86 /src/librustdoc
parent17dfae79bbc3dabe1427073086acf7f7bd45148c (diff)
downloadrust-d442a372621f70bd63f42917becf184387cfe3d4.tar.gz
rust-d442a372621f70bd63f42917becf184387cfe3d4.zip
Fix invalid extra dot after version if no source
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/html/render/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 32e4a829184..0b6faa4b13e 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1676,11 +1676,12 @@ fn render_rightside(
         containing_item.stable_since(tcx),
         const_stable_since,
     );
-    if has_stability {
+    let mut tmp_buf = Buffer::empty_from(w);
+    write_srclink(cx, item, &mut tmp_buf);
+    if has_stability && !tmp_buf.is_empty() {
         w.write_str(" ยท ");
     }
-
-    write_srclink(cx, item, w);
+    w.push_buffer(tmp_buf);
     w.write_str("</div>");
 }