Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change one FxHashMap to FxIndexMap in librustdoc #138871

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/librustdoc/formats/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ use crate::visit_lib::RustdocEffectiveVisibilities;
/// to be a fairly large and expensive structure to clone. Instead this adheres
/// to `Send` so it may be stored in an `Arc` instance and shared among the various
/// rendering threads.
///
/// To promote reproducibility across operating systems, this structure
/// intentionally does not use [`rustc_data_structures::fx::FxHashMap`].
/// Elements can be stored in deferent orders in an `FxHashMap`, even if the
/// elements are inserted in the same order. Wherever an `FxHashMap` would be
/// needed, an [`rustc_data_structures::fx::FxIndexMap`] is used instead.
#[derive(Default)]
pub(crate) struct Cache {
/// Maps a type ID to all known implementations for that type. This is only
Expand All @@ -47,7 +53,7 @@ pub(crate) struct Cache {

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

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