rustdoc: Only link to local inlined foreign items

This commit alters rustdoc to keep a hash set of known inlined items which is a
whitelist for generating URLs to.

Closes #14438
This commit is contained in:
Alex Crichton
2014-05-26 21:51:59 -07:00
parent 911cc9c352
commit 4ef535ebd0
5 changed files with 15 additions and 1 deletions

View File

@@ -150,7 +150,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, p: &clean::Path,
print_all: bool) -> fmt::Result {
path(w, p, print_all,
|cache, loc| {
if ast_util::is_local(did) || cache.paths.contains_key(&did) {
if ast_util::is_local(did) || cache.inlined.contains(&did) {
Some(("../".repeat(loc.len())).to_string())
} else {
match *cache.extern_locations.get(&did.krate) {