about summary refs log tree commit diff
path: root/src/librustdoc/html/sources.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2020-05-29 11:31:55 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2020-06-01 08:26:38 -0400
commit0a91077ff9de48d4b05c7a081964b876f61a5f68 (patch)
tree328f017ca607a3ead8966f9ec5f14d8b2e9836fa /src/librustdoc/html/sources.rs
parent991248438dd7aa185ef50ac94d7325c2cc063f1a (diff)
downloadrust-0a91077ff9de48d4b05c7a081964b876f61a5f68.tar.gz
rust-0a91077ff9de48d4b05c7a081964b876f61a5f68.zip
Split payload of FileName::Real to track both real and virutalized paths.
Such splits arise from metadata refs into libstd.

This way, we can (in a follow on commit) continue to emit the virtual name into
things like the like the StableSourceFileId that ends up in incremetnal build
artifacts, while still using the devirtualized file path when we want to access
the file.

Note that this commit is intended to be a refactoring; the actual fix to the bug
in question is in a follow-on commit.
Diffstat (limited to 'src/librustdoc/html/sources.rs')
-rw-r--r--src/librustdoc/html/sources.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs
index c5f44baced2..018c0e82c45 100644
--- a/src/librustdoc/html/sources.rs
+++ b/src/librustdoc/html/sources.rs
@@ -67,10 +67,10 @@ impl<'a> SourceCollector<'a> {
     /// Renders the given filename into its corresponding HTML source file.
     fn emit_source(&mut self, filename: &FileName) -> Result<(), Error> {
         let p = match *filename {
-            FileName::Real(ref file) => file,
+            FileName::Real(ref file) => file.local_path().to_path_buf(),
             _ => return Ok(()),
         };
-        if self.scx.local_sources.contains_key(&**p) {
+        if self.scx.local_sources.contains_key(&*p) {
             // We've already emitted this source
             return Ok(());
         }