diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2020-05-29 11:31:55 -0400 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2020-05-29 23:41:45 -0400 |
| commit | da09fd3db0c71680e16311140d07e8f1e079af82 (patch) | |
| tree | 63100f855b06ffe43d5cd9f4dba9489e20babf54 /src/librustdoc/html/render.rs | |
| parent | 905d738b1af874e248b9fe7fe4b115458975d401 (diff) | |
| download | rust-da09fd3db0c71680e16311140d07e8f1e079af82.tar.gz rust-da09fd3db0c71680e16311140d07e8f1e079af82.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/render.rs')
| -rw-r--r-- | src/librustdoc/html/render.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index cd49da88d96..f6fb10b0180 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -473,7 +473,7 @@ pub fn run( } = options; let src_root = match krate.src { - FileName::Real(ref p) => match p.parent() { + FileName::Real(ref p) => match p.local_path().parent() { Some(p) => p.to_path_buf(), None => PathBuf::new(), }, @@ -1621,9 +1621,10 @@ impl Context { // We can safely ignore synthetic `SourceFile`s. let file = match item.source.filename { - FileName::Real(ref path) => path, + FileName::Real(ref path) => path.local_path().to_path_buf(), _ => return None, }; + let file = &file; let (krate, path) = if item.source.cnum == LOCAL_CRATE { if let Some(path) = self.shared.local_sources.get(file) { |
