1
1
use std:: mem;
2
2
3
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
3
+ use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap , FxIndexSet } ;
4
4
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet } ;
5
5
use rustc_middle:: ty:: { self , TyCtxt } ;
6
6
use rustc_span:: Symbol ;
@@ -42,7 +42,7 @@ pub(crate) struct Cache {
42
42
/// URLs when a type is being linked to. External paths are not located in
43
43
/// this map because the `External` type itself has all the information
44
44
/// necessary.
45
- pub ( crate ) paths : FxHashMap < DefId , ( Vec < Symbol > , ItemType ) > ,
45
+ pub ( crate ) paths : FxIndexMap < DefId , ( Vec < Symbol > , ItemType ) > ,
46
46
47
47
/// Similar to `paths`, but only holds external paths. This is only used for
48
48
/// generating explicit hyperlinks to other crates.
@@ -64,18 +64,18 @@ pub(crate) struct Cache {
64
64
/// Implementations of a crate should inherit the documentation of the
65
65
/// parent trait if no extra documentation is specified, and default methods
66
66
/// should show up in documentation about trait implementations.
67
- pub ( crate ) traits : FxHashMap < DefId , clean:: Trait > ,
67
+ pub ( crate ) traits : FxIndexMap < DefId , clean:: Trait > ,
68
68
69
69
/// When rendering traits, it's often useful to be able to list all
70
70
/// implementors of the trait, and this mapping is exactly, that: a mapping
71
71
/// of trait ids to the list of known implementors of the trait
72
- pub ( crate ) implementors : FxHashMap < DefId , Vec < Impl > > ,
72
+ pub ( crate ) implementors : FxIndexMap < DefId , Vec < Impl > > ,
73
73
74
74
/// Cache of where external crate documentation can be found.
75
- pub ( crate ) extern_locations : FxHashMap < CrateNum , ExternalLocation > ,
75
+ pub ( crate ) extern_locations : FxIndexMap < CrateNum , ExternalLocation > ,
76
76
77
77
/// Cache of where documentation for primitives can be found.
78
- pub ( crate ) primitive_locations : FxHashMap < clean:: PrimitiveType , DefId > ,
78
+ pub ( crate ) primitive_locations : FxIndexMap < clean:: PrimitiveType , DefId > ,
79
79
80
80
// Note that external items for which `doc(hidden)` applies to are shown as
81
81
// non-reachable while local items aren't. This is because we're reusing
@@ -118,7 +118,7 @@ pub(crate) struct Cache {
118
118
// crawl. In order to prevent crashes when looking for notable traits or
119
119
// when gathering trait documentation on a type, hold impls here while
120
120
// folding and add them to the cache later on if we find the trait.
121
- orphan_trait_impls : Vec < ( DefId , FxHashSet < DefId > , Impl ) > ,
121
+ orphan_trait_impls : Vec < ( DefId , FxIndexSet < DefId > , Impl ) > ,
122
122
123
123
/// All intra-doc links resolved so far.
124
124
///
@@ -376,7 +376,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
376
376
// Figure out the id of this impl. This may map to a
377
377
// primitive rather than always to a struct/enum.
378
378
// Note: matching twice to restrict the lifetime of the `i` borrow.
379
- let mut dids = FxHashSet :: default ( ) ;
379
+ let mut dids = FxIndexSet :: default ( ) ;
380
380
match i. for_ {
381
381
clean:: Type :: Path { ref path }
382
382
| clean:: BorrowedRef { type_ : box clean:: Type :: Path { ref path } , .. } => {
0 commit comments