about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2021-03-22 21:18:06 -0700
committerCamelid <camelidcamel@gmail.com>2021-03-22 21:18:06 -0700
commitc9ae35978c8520227b360830ff6971f2887c98a2 (patch)
tree4c74095ae5c8bd63169e1a7d8a8aa1874e34bd10
parent72a180e134f2be8b0b390e87189c638f3a20810c (diff)
downloadrust-c9ae35978c8520227b360830ff6971f2887c98a2.tar.gz
rust-c9ae35978c8520227b360830ff6971f2887c98a2.zip
Don't push the crate name onto the `Cache.stack`
Now that we record the crate's name in its `clean::Item`, pushing the
crate name onto the `stack` causes duplicate paths. E.g., the URL
generated for the path `::foo::bar::baz` would be something like

    ../foo/foo/bar/baz

With this commit, the URL is corrected to

    ../foo/bar/baz
-rw-r--r--src/librustdoc/formats/cache.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs
index 9415caf8b6f..f9a663b38eb 100644
--- a/src/librustdoc/formats/cache.rs
+++ b/src/librustdoc/formats/cache.rs
@@ -182,8 +182,6 @@ impl Cache {
             self.primitive_locations.insert(prim, def_id);
         }
 
-        self.stack.push(krate.name.to_string());
-
         krate = CacheBuilder { tcx, cache: self, empty_cache: Cache::default() }.fold_crate(krate);
 
         for (trait_did, dids, impl_) in self.orphan_trait_impls.drain(..) {