diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2017-12-28 17:49:36 +0000 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2017-12-28 17:51:31 +0000 |
| commit | 95f9491bc797e9e41176dbb9fecc5cb8e27d95e7 (patch) | |
| tree | 9c55ca05818457575af21754bd8ff5596b46c328 /src/librustdoc/html/format.rs | |
| parent | 0efdfa1d6220484770e3730062b92a9d2b2e20b9 (diff) | |
| download | rust-95f9491bc797e9e41176dbb9fecc5cb8e27d95e7.tar.gz rust-95f9491bc797e9e41176dbb9fecc5cb8e27d95e7.zip | |
rustdoc: Don't try to generate links for modules in import paths
The modules may be private or may even be enums so it would generate dead links.
Diffstat (limited to 'src/librustdoc/html/format.rs')
| -rw-r--r-- | src/librustdoc/html/format.rs | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 7300721c384..92b3a404c57 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -435,32 +435,10 @@ pub fn href(did: DefId) -> Option<(String, ItemType, Vec<String>)> { fn resolved_path(w: &mut fmt::Formatter, did: DefId, path: &clean::Path, print_all: bool, use_absolute: bool) -> fmt::Result { let last = path.segments.last().unwrap(); - let rel_root = match &*path.segments[0].name { - "self" => Some("./".to_string()), - _ => None, - }; if print_all { - let amt = path.segments.len() - 1; - match rel_root { - Some(mut root) => { - for seg in &path.segments[..amt] { - if "super" == seg.name || "self" == seg.name || w.alternate() { - write!(w, "{}::", seg.name)?; - } else { - root.push_str(&seg.name); - root.push_str("/"); - write!(w, "<a class=\"mod\" href=\"{}index.html\">{}</a>::", - root, - seg.name)?; - } - } - } - None => { - for seg in &path.segments[..amt] { - write!(w, "{}::", seg.name)?; - } - } + for seg in &path.segments[..path.segments.len() - 1] { + write!(w, "{}::", seg.name)?; } } if w.alternate() { |
