From 0ccb0643d5ffa8cc68537c5e9941b37304642786 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 16 Feb 2019 17:40:53 +0100 Subject: [PATCH] Make external_html_url_root takes precedence over local dir --- src/librustdoc/html/render.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index a85ac19286af5..02ceb7f452d85 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1355,12 +1355,6 @@ fn clean_srcpath(src_root: &Path, p: &Path, keep_filename: bool, mut f: F) wh fn extern_location(e: &clean::ExternalCrate, extern_url: Option<&str>, dst: &Path) -> ExternalLocation { - // See if there's documentation generated into the local directory - let local_location = dst.join(&e.name); - if local_location.is_dir() { - return Local; - } - if let Some(url) = extern_url { let mut url = url.to_string(); if !url.ends_with("/") { @@ -1369,6 +1363,12 @@ fn extern_location(e: &clean::ExternalCrate, extern_url: Option<&str>, dst: &Pat return Remote(url); } + // See if there's documentation generated into the local directory + let local_location = dst.join(&e.name); + if local_location.is_dir() { + return Local; + } + // Failing that, see if there's an attribute specifying where to find this // external crate e.attrs.lists("doc")