diff options
| author | bors <bors@rust-lang.org> | 2020-06-01 15:42:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-01 15:42:51 +0000 |
| commit | 49cae55760da0a43428eba73abcb659bb70cf2e4 (patch) | |
| tree | 4aaa1c51870e6e83fda6d1c86d6bac54457ab89b /src/librustdoc | |
| parent | 02c25b359e667d2eba0da4d9e75408d675b7a4d5 (diff) | |
| parent | 68a0acd6341440bd6ae6e0b612f558b10e6d522f (diff) | |
| download | rust-1.44.0.tar.gz rust-1.44.0.zip | |
Auto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.44.0
[stable] 1.44 release This includes a release notes update as usual and a backport of #72767. r? @ghost
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/html/render.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/sources.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b91aab44f10..fce5a815fe2 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -465,7 +465,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(), }, @@ -1650,9 +1650,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) { diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index 5b090291227..be800c3c794 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -173,7 +173,7 @@ impl Cache { // Cache where all our extern crates are located for &(n, ref e) in &krate.externs { let src_root = match e.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(), }, 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(()); } diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index afc1501d7b6..86bba15a6f9 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -663,7 +663,7 @@ impl Collector { let filename = source_map.span_to_filename(self.position); if let FileName::Real(ref filename) = filename { if let Ok(cur_dir) = env::current_dir() { - if let Ok(path) = filename.strip_prefix(&cur_dir) { + if let Ok(path) = filename.local_path().strip_prefix(&cur_dir) { return path.to_owned().into(); } } @@ -693,7 +693,7 @@ impl Tester for Collector { // FIXME(#44940): if doctests ever support path remapping, then this filename // needs to be the result of `SourceMap::span_to_unmapped_path`. let path = match &filename { - FileName::Real(path) => path.clone(), + FileName::Real(path) => path.local_path().to_path_buf(), _ => PathBuf::from(r"doctest.rs"), }; |
