diff options
| author | ismailarilik <arilik.ismail@gmail.com> | 2024-10-06 10:39:03 +0300 |
|---|---|---|
| committer | ismailarilik <arilik.ismail@gmail.com> | 2024-10-06 10:39:03 +0300 |
| commit | e0a20b484d0b88183ddd46b82aa47d7bbfe48468 (patch) | |
| tree | d51f1e856c1054347a3da443d9a714c604543f11 /src/librustdoc/formats | |
| parent | 85e2f55d8291e643b5b4c98ee09db301379d63a6 (diff) | |
| download | rust-e0a20b484d0b88183ddd46b82aa47d7bbfe48468.tar.gz rust-e0a20b484d0b88183ddd46b82aa47d7bbfe48468.zip | |
Handle `librustdoc` cases of `rustc::potential_query_instability` lint
Diffstat (limited to 'src/librustdoc/formats')
| -rw-r--r-- | src/librustdoc/formats/cache.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index db1a0bd0af9..ff0d537b19f 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -1,6 +1,6 @@ use std::mem; -use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; +use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet}; use rustc_middle::ty::{self, TyCtxt}; use rustc_span::Symbol; @@ -42,7 +42,7 @@ pub(crate) struct Cache { /// URLs when a type is being linked to. External paths are not located in /// this map because the `External` type itself has all the information /// necessary. - pub(crate) paths: FxHashMap<DefId, (Vec<Symbol>, ItemType)>, + pub(crate) paths: FxIndexMap<DefId, (Vec<Symbol>, ItemType)>, /// Similar to `paths`, but only holds external paths. This is only used for /// generating explicit hyperlinks to other crates. @@ -64,18 +64,18 @@ pub(crate) struct Cache { /// Implementations of a crate should inherit the documentation of the /// parent trait if no extra documentation is specified, and default methods /// should show up in documentation about trait implementations. - pub(crate) traits: FxHashMap<DefId, clean::Trait>, + pub(crate) traits: FxIndexMap<DefId, clean::Trait>, /// When rendering traits, it's often useful to be able to list all /// implementors of the trait, and this mapping is exactly, that: a mapping /// of trait ids to the list of known implementors of the trait - pub(crate) implementors: FxHashMap<DefId, Vec<Impl>>, + pub(crate) implementors: FxIndexMap<DefId, Vec<Impl>>, /// Cache of where external crate documentation can be found. - pub(crate) extern_locations: FxHashMap<CrateNum, ExternalLocation>, + pub(crate) extern_locations: FxIndexMap<CrateNum, ExternalLocation>, /// Cache of where documentation for primitives can be found. - pub(crate) primitive_locations: FxHashMap<clean::PrimitiveType, DefId>, + pub(crate) primitive_locations: FxIndexMap<clean::PrimitiveType, DefId>, // Note that external items for which `doc(hidden)` applies to are shown as // non-reachable while local items aren't. This is because we're reusing @@ -118,7 +118,7 @@ pub(crate) struct Cache { // crawl. In order to prevent crashes when looking for notable traits or // when gathering trait documentation on a type, hold impls here while // folding and add them to the cache later on if we find the trait. - orphan_trait_impls: Vec<(DefId, FxHashSet<DefId>, Impl)>, + orphan_trait_impls: Vec<(DefId, FxIndexSet<DefId>, Impl)>, /// All intra-doc links resolved so far. /// @@ -376,7 +376,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> { // Figure out the id of this impl. This may map to a // primitive rather than always to a struct/enum. // Note: matching twice to restrict the lifetime of the `i` borrow. - let mut dids = FxHashSet::default(); + let mut dids = FxIndexSet::default(); match i.for_ { clean::Type::Path { ref path } | clean::BorrowedRef { type_: box clean::Type::Path { ref path }, .. } => { |
