Skip to content

Commit fb97d2f

Browse files
committed
Change one FxHashMap to FxIndexMap in librustdoc
1 parent aa8f0fd commit fb97d2f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustdoc/formats/cache.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ use crate::visit_lib::RustdocEffectiveVisibilities;
2828
/// to be a fairly large and expensive structure to clone. Instead this adheres
2929
/// to `Send` so it may be stored in an `Arc` instance and shared among the various
3030
/// rendering threads.
31+
///
32+
/// To promote reproducibility across operating systems, this structure
33+
/// intentionally does not use [`rustc_data_structures::fx::FxHashMap`].
34+
/// Elements can be stored in deferent orders in an `FxHashMap`, even if the
35+
/// elements are inserted in the same order. Wherever an `FxHashMap` would be
36+
/// needed, an [`rustc_data_structures::fx::FxIndexMap`] is used instead.
3137
#[derive(Default)]
3238
pub(crate) struct Cache {
3339
/// Maps a type ID to all known implementations for that type. This is only
@@ -47,7 +53,7 @@ pub(crate) struct Cache {
4753

4854
/// Similar to `paths`, but only holds external paths. This is only used for
4955
/// generating explicit hyperlinks to other crates.
50-
pub(crate) external_paths: FxHashMap<DefId, (Vec<Symbol>, ItemType)>,
56+
pub(crate) external_paths: FxIndexMap<DefId, (Vec<Symbol>, ItemType)>,
5157

5258
/// Maps local `DefId`s of exported types to fully qualified paths.
5359
/// Unlike 'paths', this mapping ignores any renames that occur

0 commit comments

Comments
 (0)