Skip to content

Commit d03df0a

Browse files
committed
Add rustdoc hack
1 parent cf3ab41 commit d03df0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustdoc/html/render/search_index.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ pub(crate) fn build_index<'tcx>(
6565
// Sort search index items. This improves the compressibility of the search index.
6666
cache.search_index.sort_unstable_by(|k1, k2| {
6767
// `sort_unstable_by_key` produces lifetime errors
68-
let k1 = (&k1.path, k1.name.as_str(), &k1.ty, &k1.parent.map(|id| tcx.def_path_str(id)));
69-
let k2 = (&k2.path, k2.name.as_str(), &k2.ty, &k2.parent.map(|id| tcx.def_path_str(id)));
68+
// HACK(rustdoc): should not be sorting `CrateNum` or `DefIndex`, this will soon go away, too
69+
let k1 = (&k1.path, k1.name.as_str(), &k1.ty, k1.parent.map(|id| (id.index, id.krate)));
70+
let k2 = (&k2.path, k2.name.as_str(), &k2.ty, k2.parent.map(|id| (id.index, id.krate)));
7071
Ord::cmp(&k1, &k2)
7172
});
7273

0 commit comments

Comments
 (0)