Skip to content

Commit fe98de2

Browse files
committed
intra-doc links: Resolve modules in type namespace
1 parent 3014f23 commit fe98de2

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+8-15
Original file line numberDiff line numberDiff line change
@@ -584,25 +584,18 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
584584
let (res, fragment) = {
585585
let mut kind = None;
586586
let mut disambiguator = None;
587-
path_str = if let Some(prefix) = ["struct@", "enum@", "type@", "trait@", "union@"]
588-
.iter()
589-
.find(|p| link.starts_with(**p))
587+
path_str = if let Some(prefix) =
588+
["struct@", "enum@", "type@", "trait@", "union@", "module@", "mod@"]
589+
.iter()
590+
.find(|p| link.starts_with(**p))
590591
{
591592
kind = Some(TypeNS);
592593
disambiguator = Some(&prefix[..prefix.len() - 1]);
593594
link.trim_start_matches(prefix)
594-
} else if let Some(prefix) = [
595-
"const@",
596-
"static@",
597-
"value@",
598-
"function@",
599-
"mod@",
600-
"fn@",
601-
"module@",
602-
"method@",
603-
]
604-
.iter()
605-
.find(|p| link.starts_with(**p))
595+
} else if let Some(prefix) =
596+
["const@", "static@", "value@", "function@", "fn@", "method@"]
597+
.iter()
598+
.find(|p| link.starts_with(**p))
606599
{
607600
kind = Some(ValueNS);
608601
disambiguator = Some(&prefix[..prefix.len() - 1]);

0 commit comments

Comments
 (0)