about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-06-27 00:22:03 -0700
committerManish Goregaokar <manishsmail@gmail.com>2020-07-09 08:44:28 -0700
commit08d3a74a8f2538714129386f3f1a7153c49c9300 (patch)
tree0255025274a10a9c26da04e303f5ae0ec434c04f
parent5db778affee7c6600c8e7a177c48282dab3f6292 (diff)
downloadrust-08d3a74a8f2538714129386f3f1a7153c49c9300.tar.gz
rust-08d3a74a8f2538714129386f3f1a7153c49c9300.zip
Allow for parentheses after macro intra-doc-links
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index f1d1bf439f1..4fcf6ceb44d 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -602,6 +602,9 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
                     kind = Some(ValueNS);
                     disambiguator = Some(&prefix[..prefix.len() - 1]);
                     link.trim_start_matches(prefix)
+                } else if link.ends_with("!()") {
+                    kind = Some(MacroNS);
+                    link.trim_end_matches("!()")
                 } else if link.ends_with("()") {
                     kind = Some(ValueNS);
                     disambiguator = Some("fn");