]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/render/context.rs
Use local and remapped paths where appropriate
[rust.git] / src / librustdoc / html / render / context.rs
index 293c0a40fa79966712e3563d7f5c216905f14c5b..288c7785bc9ecb0f49fa5244363cdd992935a78f 100644 (file)
@@ -290,7 +290,7 @@ pub(super) fn src_href(&self, item: &clean::Item) -> Option<String> {
 
         // We can safely ignore synthetic `SourceFile`s.
         let file = match item.span(self.tcx()).filename(self.sess()) {
-            FileName::Real(ref path) => path.local_path().to_path_buf(),
+            FileName::Real(ref path) => path.local_path_if_available().to_path_buf(),
             _ => return None,
         };
         let file = &file;
@@ -376,7 +376,7 @@ fn init(
         } = options;
 
         let src_root = match krate.src {
-            FileName::Real(ref p) => match p.local_path().parent() {
+            FileName::Real(ref p) => match p.local_path_if_available().parent() {
                 Some(p) => p.to_path_buf(),
                 None => PathBuf::new(),
             },