about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-28 06:06:47 -0700
committerbors <bors@rust-lang.org>2014-05-28 06:06:47 -0700
commit24b1ce1daf9dbf66d04116d0549a48a7610bc614 (patch)
tree5a14e8fe2be8761df43e60cecbc3861331a34b2c
parentbee42a9413f0ecc65110b16846fb92ae1ba91dba (diff)
parent3482ab3699784d5fa838b8e3ddbef9dee19bce2d (diff)
downloadrust-24b1ce1daf9dbf66d04116d0549a48a7610bc614.tar.gz
rust-24b1ce1daf9dbf66d04116d0549a48a7610bc614.zip
auto merge of #14458 : huonw/rust/rustdoc-cross-crate-link-path, r=alexcrichton
Previously this was adding one-too-many `..`s to the path for the
`gotosrc=...` links for local crates. Also, the `root_path` already ends
in `/`s so a trailing / shouldn't be added after the root (some servers
treat `...//...` different to `.../...` including the one running
doc.rust-lang.org).
-rw-r--r--src/librustdoc/html/render.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index f5c7352b9c2..d0974c25e95 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1094,10 +1094,10 @@ impl<'a> Item<'a> {
             let path = cache.external_paths.get(&self.item.def_id);
             let root = match *cache.extern_locations.get(&self.item.def_id.krate) {
                 Remote(ref s) => s.to_string(),
-                Local => format!("{}/..", self.cx.root_path),
+                Local => self.cx.root_path.clone(),
                 Unknown => return None,
             };
-            Some(format!("{root}/{path}/{file}?gotosrc={goto}",
+            Some(format!("{root}{path}/{file}?gotosrc={goto}",
                          root = root,
                          path = path.slice_to(path.len() - 1).connect("/"),
                          file = item_path(self.item),