intra-doc links: Resolve modules in type namespace
This commit is contained in:
parent
3014f23ddd
commit
fe98de2a8e
1 changed files with 8 additions and 15 deletions
|
@ -584,23 +584,16 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
|
|||
let (res, fragment) = {
|
||||
let mut kind = None;
|
||||
let mut disambiguator = None;
|
||||
path_str = if let Some(prefix) = ["struct@", "enum@", "type@", "trait@", "union@"]
|
||||
path_str = if let Some(prefix) =
|
||||
["struct@", "enum@", "type@", "trait@", "union@", "module@", "mod@"]
|
||||
.iter()
|
||||
.find(|p| link.starts_with(**p))
|
||||
{
|
||||
kind = Some(TypeNS);
|
||||
disambiguator = Some(&prefix[..prefix.len() - 1]);
|
||||
link.trim_start_matches(prefix)
|
||||
} else if let Some(prefix) = [
|
||||
"const@",
|
||||
"static@",
|
||||
"value@",
|
||||
"function@",
|
||||
"mod@",
|
||||
"fn@",
|
||||
"module@",
|
||||
"method@",
|
||||
]
|
||||
} else if let Some(prefix) =
|
||||
["const@", "static@", "value@", "function@", "fn@", "method@"]
|
||||
.iter()
|
||||
.find(|p| link.starts_with(**p))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue