Skip to content

Commit 3482ab3

Browse files
committed
rustdoc: cross-crate source links are one level lower.
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).
1 parent 0a092a8 commit 3482ab3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1094,10 +1094,10 @@ impl<'a> Item<'a> {
10941094
let path = cache.external_paths.get(&self.item.def_id);
10951095
let root = match *cache.extern_locations.get(&self.item.def_id.krate) {
10961096
Remote(ref s) => s.to_string(),
1097-
Local => format!("{}/..", self.cx.root_path),
1097+
Local => self.cx.root_path.clone(),
10981098
Unknown => return None,
10991099
};
1100-
Some(format!("{root}/{path}/{file}?gotosrc={goto}",
1100+
Some(format!("{root}{path}/{file}?gotosrc={goto}",
11011101
root = root,
11021102
path = path.slice_to(path.len() - 1).connect("/"),
11031103
file = item_path(self.item),

0 commit comments

Comments
 (0)