rustdoc: remove std:: from primitive intra-doc link tooltips
This commit is contained in:
parent
e4b9f86054
commit
683c12cb91
2 changed files with 8 additions and 0 deletions
|
|
@ -771,6 +771,12 @@ pub(crate) fn link_tooltip(did: DefId, fragment: &Option<UrlFragment>, cx: &Cont
|
|||
.or_else(|| cache.external_paths.get(&did))
|
||||
else { return String::new() };
|
||||
let mut buf = Buffer::new();
|
||||
let fqp = if *shortty == ItemType::Primitive {
|
||||
// primitives are documented in a crate, but not actually part of it
|
||||
&fqp[fqp.len() - 1..]
|
||||
} else {
|
||||
&fqp
|
||||
};
|
||||
if let &Some(UrlFragment::Item(id)) = fragment {
|
||||
write!(buf, "{} ", cx.tcx().def_descr(id));
|
||||
for component in fqp {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue