Auto merge of #119093 - michaelwoerister:mcp533-18, r=petrochenkov
Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) Part of https://github.com/rust-lang/compiler-team/issues/533. We should be getting close to being able to remove the HashStable impl of HashMap.
This commit is contained in:
commit
32f5db9890
@ -1,7 +1,6 @@
|
|||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_data_structures::sorted_map::SortedMap;
|
use rustc_data_structures::sorted_map::SortedMap;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def_id::LocalDefId;
|
use rustc_hir::def_id::{LocalDefId, LocalDefIdMap};
|
||||||
use rustc_hir::intravisit::Visitor;
|
use rustc_hir::intravisit::Visitor;
|
||||||
use rustc_hir::*;
|
use rustc_hir::*;
|
||||||
use rustc_index::{Idx, IndexVec};
|
use rustc_index::{Idx, IndexVec};
|
||||||
@ -17,7 +16,7 @@ struct NodeCollector<'a, 'hir> {
|
|||||||
|
|
||||||
/// Outputs
|
/// Outputs
|
||||||
nodes: IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>,
|
nodes: IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>,
|
||||||
parenting: FxHashMap<LocalDefId, ItemLocalId>,
|
parenting: LocalDefIdMap<ItemLocalId>,
|
||||||
|
|
||||||
/// The parent of this node
|
/// The parent of this node
|
||||||
parent_node: hir::ItemLocalId,
|
parent_node: hir::ItemLocalId,
|
||||||
@ -30,7 +29,7 @@ pub(super) fn index_hir<'hir>(
|
|||||||
tcx: TyCtxt<'hir>,
|
tcx: TyCtxt<'hir>,
|
||||||
item: hir::OwnerNode<'hir>,
|
item: hir::OwnerNode<'hir>,
|
||||||
bodies: &SortedMap<ItemLocalId, &'hir Body<'hir>>,
|
bodies: &SortedMap<ItemLocalId, &'hir Body<'hir>>,
|
||||||
) -> (IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>, FxHashMap<LocalDefId, ItemLocalId>) {
|
) -> (IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>, LocalDefIdMap<ItemLocalId>) {
|
||||||
let mut nodes = IndexVec::new();
|
let mut nodes = IndexVec::new();
|
||||||
// This node's parent should never be accessed: the owner's parent is computed by the
|
// This node's parent should never be accessed: the owner's parent is computed by the
|
||||||
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
|
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
|
||||||
@ -42,7 +41,7 @@ pub(super) fn index_hir<'hir>(
|
|||||||
parent_node: ItemLocalId::new(0),
|
parent_node: ItemLocalId::new(0),
|
||||||
nodes,
|
nodes,
|
||||||
bodies,
|
bodies,
|
||||||
parenting: FxHashMap::default(),
|
parenting: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
match item {
|
match item {
|
||||||
|
@ -44,20 +44,20 @@ extern crate tracing;
|
|||||||
|
|
||||||
use crate::errors::{AssocTyParentheses, AssocTyParenthesesSub, MisplacedImplTrait};
|
use crate::errors::{AssocTyParentheses, AssocTyParenthesesSub, MisplacedImplTrait};
|
||||||
|
|
||||||
|
use rustc_ast::node_id::NodeMap;
|
||||||
use rustc_ast::ptr::P;
|
use rustc_ast::ptr::P;
|
||||||
use rustc_ast::{self as ast, *};
|
use rustc_ast::{self as ast, *};
|
||||||
use rustc_ast_pretty::pprust;
|
use rustc_ast_pretty::pprust;
|
||||||
use rustc_data_structures::captures::Captures;
|
use rustc_data_structures::captures::Captures;
|
||||||
use rustc_data_structures::fingerprint::Fingerprint;
|
use rustc_data_structures::fingerprint::Fingerprint;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_data_structures::sorted_map::SortedMap;
|
use rustc_data_structures::sorted_map::SortedMap;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_errors::{DiagnosticArgFromDisplay, StashKey};
|
use rustc_errors::{DiagnosticArgFromDisplay, StashKey};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
|
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
|
||||||
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
|
use rustc_hir::def_id::{LocalDefId, LocalDefIdMap, CRATE_DEF_ID, LOCAL_CRATE};
|
||||||
use rustc_hir::{ConstArg, GenericArg, ItemLocalId, ParamName, TraitCandidate};
|
use rustc_hir::{ConstArg, GenericArg, ItemLocalMap, ParamName, TraitCandidate};
|
||||||
use rustc_index::{Idx, IndexSlice, IndexVec};
|
use rustc_index::{Idx, IndexSlice, IndexVec};
|
||||||
use rustc_middle::span_bug;
|
use rustc_middle::span_bug;
|
||||||
use rustc_middle::ty::{ResolverAstLowering, TyCtxt, Visibility};
|
use rustc_middle::ty::{ResolverAstLowering, TyCtxt, Visibility};
|
||||||
@ -119,13 +119,13 @@ struct LoweringContext<'a, 'hir> {
|
|||||||
|
|
||||||
current_hir_id_owner: hir::OwnerId,
|
current_hir_id_owner: hir::OwnerId,
|
||||||
item_local_id_counter: hir::ItemLocalId,
|
item_local_id_counter: hir::ItemLocalId,
|
||||||
trait_map: FxHashMap<ItemLocalId, Box<[TraitCandidate]>>,
|
trait_map: ItemLocalMap<Box<[TraitCandidate]>>,
|
||||||
|
|
||||||
impl_trait_defs: Vec<hir::GenericParam<'hir>>,
|
impl_trait_defs: Vec<hir::GenericParam<'hir>>,
|
||||||
impl_trait_bounds: Vec<hir::WherePredicate<'hir>>,
|
impl_trait_bounds: Vec<hir::WherePredicate<'hir>>,
|
||||||
|
|
||||||
/// NodeIds that are lowered inside the current HIR owner.
|
/// NodeIds that are lowered inside the current HIR owner.
|
||||||
node_id_to_local_id: FxHashMap<NodeId, hir::ItemLocalId>,
|
node_id_to_local_id: NodeMap<hir::ItemLocalId>,
|
||||||
|
|
||||||
allow_try_trait: Lrc<[Symbol]>,
|
allow_try_trait: Lrc<[Symbol]>,
|
||||||
allow_gen_future: Lrc<[Symbol]>,
|
allow_gen_future: Lrc<[Symbol]>,
|
||||||
@ -135,7 +135,7 @@ struct LoweringContext<'a, 'hir> {
|
|||||||
/// For each captured lifetime (e.g., 'a), we create a new lifetime parameter that is a generic
|
/// For each captured lifetime (e.g., 'a), we create a new lifetime parameter that is a generic
|
||||||
/// defined on the TAIT, so we have type Foo<'a1> = ... and we establish a mapping in this
|
/// defined on the TAIT, so we have type Foo<'a1> = ... and we establish a mapping in this
|
||||||
/// field from the original parameter 'a to the new parameter 'a1.
|
/// field from the original parameter 'a to the new parameter 'a1.
|
||||||
generics_def_id_map: Vec<FxHashMap<LocalDefId, LocalDefId>>,
|
generics_def_id_map: Vec<LocalDefIdMap<LocalDefId>>,
|
||||||
|
|
||||||
host_param_id: Option<LocalDefId>,
|
host_param_id: Option<LocalDefId>,
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ enum AstOwner<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn index_crate<'a>(
|
fn index_crate<'a>(
|
||||||
node_id_to_def_id: &FxHashMap<NodeId, LocalDefId>,
|
node_id_to_def_id: &NodeMap<LocalDefId>,
|
||||||
krate: &'a Crate,
|
krate: &'a Crate,
|
||||||
) -> IndexVec<LocalDefId, AstOwner<'a>> {
|
) -> IndexVec<LocalDefId, AstOwner<'a>> {
|
||||||
let mut indexer = Indexer { node_id_to_def_id, index: IndexVec::new() };
|
let mut indexer = Indexer { node_id_to_def_id, index: IndexVec::new() };
|
||||||
@ -390,7 +390,7 @@ fn index_crate<'a>(
|
|||||||
return indexer.index;
|
return indexer.index;
|
||||||
|
|
||||||
struct Indexer<'s, 'a> {
|
struct Indexer<'s, 'a> {
|
||||||
node_id_to_def_id: &'s FxHashMap<NodeId, LocalDefId>,
|
node_id_to_def_id: &'s NodeMap<LocalDefId>,
|
||||||
index: IndexVec<LocalDefId, AstOwner<'a>>,
|
index: IndexVec<LocalDefId, AstOwner<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,7 +642,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
/// `'a` declared on the TAIT, instead of the function.
|
/// `'a` declared on the TAIT, instead of the function.
|
||||||
fn with_remapping<R>(
|
fn with_remapping<R>(
|
||||||
&mut self,
|
&mut self,
|
||||||
remap: FxHashMap<LocalDefId, LocalDefId>,
|
remap: LocalDefIdMap<LocalDefId>,
|
||||||
f: impl FnOnce(&mut Self) -> R,
|
f: impl FnOnce(&mut Self) -> R,
|
||||||
) -> R {
|
) -> R {
|
||||||
self.generics_def_id_map.push(remap);
|
self.generics_def_id_map.push(remap);
|
||||||
@ -1657,7 +1657,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
|
|
||||||
// Map from captured (old) lifetime to synthetic (new) lifetime.
|
// Map from captured (old) lifetime to synthetic (new) lifetime.
|
||||||
// Used to resolve lifetimes in the bounds of the opaque.
|
// Used to resolve lifetimes in the bounds of the opaque.
|
||||||
let mut captured_to_synthesized_mapping = FxHashMap::default();
|
let mut captured_to_synthesized_mapping = LocalDefIdMap::default();
|
||||||
// List of (early-bound) synthetic lifetimes that are owned by the opaque.
|
// List of (early-bound) synthetic lifetimes that are owned by the opaque.
|
||||||
// This is used to create the `hir::Generics` owned by the opaque.
|
// This is used to create the `hir::Generics` owned by the opaque.
|
||||||
let mut synthesized_lifetime_definitions = vec![];
|
let mut synthesized_lifetime_definitions = vec![];
|
||||||
|
@ -3,8 +3,8 @@ use crate::hir;
|
|||||||
|
|
||||||
use rustc_ast as ast;
|
use rustc_ast as ast;
|
||||||
use rustc_ast::NodeId;
|
use rustc_ast::NodeId;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_data_structures::stable_hasher::ToStableHashKey;
|
use rustc_data_structures::stable_hasher::ToStableHashKey;
|
||||||
|
use rustc_data_structures::unord::UnordMap;
|
||||||
use rustc_macros::HashStable_Generic;
|
use rustc_macros::HashStable_Generic;
|
||||||
use rustc_span::def_id::{DefId, LocalDefId};
|
use rustc_span::def_id::{DefId, LocalDefId};
|
||||||
use rustc_span::hygiene::MacroKind;
|
use rustc_span::hygiene::MacroKind;
|
||||||
@ -806,4 +806,4 @@ pub enum LifetimeRes {
|
|||||||
ElidedAnchor { start: NodeId, end: NodeId },
|
ElidedAnchor { start: NodeId, end: NodeId },
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type DocLinkResMap = FxHashMap<(Symbol, Namespace), Option<Res<NodeId>>>;
|
pub type DocLinkResMap = UnordMap<(Symbol, Namespace), Option<Res<NodeId>>>;
|
||||||
|
@ -8,8 +8,8 @@ pub use crate::def_id::DefPathHash;
|
|||||||
use crate::def_id::{CrateNum, DefIndex, LocalDefId, StableCrateId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
use crate::def_id::{CrateNum, DefIndex, LocalDefId, StableCrateId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||||
use crate::def_path_hash_map::DefPathHashMap;
|
use crate::def_path_hash_map::DefPathHashMap;
|
||||||
|
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_data_structures::stable_hasher::{Hash64, StableHasher};
|
use rustc_data_structures::stable_hasher::{Hash64, StableHasher};
|
||||||
|
use rustc_data_structures::unord::UnordMap;
|
||||||
use rustc_index::IndexVec;
|
use rustc_index::IndexVec;
|
||||||
use rustc_span::symbol::{kw, sym, Symbol};
|
use rustc_span::symbol::{kw, sym, Symbol};
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ impl DefPathTable {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Definitions {
|
pub struct Definitions {
|
||||||
table: DefPathTable,
|
table: DefPathTable,
|
||||||
next_disambiguator: FxHashMap<(LocalDefId, DefPathData), u32>,
|
next_disambiguator: UnordMap<(LocalDefId, DefPathData), u32>,
|
||||||
|
|
||||||
/// The [StableCrateId] of the local crate.
|
/// The [StableCrateId] of the local crate.
|
||||||
stable_crate_id: StableCrateId,
|
stable_crate_id: StableCrateId,
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
use crate::def_id::DefId;
|
use crate::def_id::DefId;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxIndexMap;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
|
use rustc_span::def_id::DefIdMap;
|
||||||
use rustc_span::Symbol;
|
use rustc_span::Symbol;
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct DiagnosticItems {
|
pub struct DiagnosticItems {
|
||||||
pub id_to_name: FxHashMap<DefId, Symbol>,
|
pub id_to_name: DefIdMap<Symbol>,
|
||||||
pub name_to_id: FxHashMap<Symbol, DefId>,
|
pub name_to_id: FxIndexMap<Symbol, DefId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CTX: crate::HashStableContext> HashStable<CTX> for DiagnosticItems {
|
impl<CTX: crate::HashStableContext> HashStable<CTX> for DiagnosticItems {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::def::{CtorKind, DefKind, Res};
|
use crate::def::{CtorKind, DefKind, Res};
|
||||||
use crate::def_id::DefId;
|
use crate::def_id::{DefId, LocalDefIdMap};
|
||||||
pub(crate) use crate::hir_id::{HirId, ItemLocalId, OwnerId};
|
pub(crate) use crate::hir_id::{HirId, ItemLocalId, ItemLocalMap, OwnerId};
|
||||||
use crate::intravisit::FnKind;
|
use crate::intravisit::FnKind;
|
||||||
use crate::LangItem;
|
use crate::LangItem;
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ pub use rustc_ast::{BinOp, BinOpKind, BindingAnnotation, BorrowKind, ByRef, Capt
|
|||||||
pub use rustc_ast::{ImplPolarity, IsAuto, Movability, Mutability, UnOp};
|
pub use rustc_ast::{ImplPolarity, IsAuto, Movability, Mutability, UnOp};
|
||||||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||||
use rustc_data_structures::fingerprint::Fingerprint;
|
use rustc_data_structures::fingerprint::Fingerprint;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
|
||||||
use rustc_data_structures::sorted_map::SortedMap;
|
use rustc_data_structures::sorted_map::SortedMap;
|
||||||
use rustc_index::IndexVec;
|
use rustc_index::IndexVec;
|
||||||
use rustc_macros::HashStable_Generic;
|
use rustc_macros::HashStable_Generic;
|
||||||
@ -874,12 +873,12 @@ pub struct OwnerInfo<'hir> {
|
|||||||
/// Contents of the HIR.
|
/// Contents of the HIR.
|
||||||
pub nodes: OwnerNodes<'hir>,
|
pub nodes: OwnerNodes<'hir>,
|
||||||
/// Map from each nested owner to its parent's local id.
|
/// Map from each nested owner to its parent's local id.
|
||||||
pub parenting: FxHashMap<LocalDefId, ItemLocalId>,
|
pub parenting: LocalDefIdMap<ItemLocalId>,
|
||||||
/// Collected attributes of the HIR nodes.
|
/// Collected attributes of the HIR nodes.
|
||||||
pub attrs: AttributeMap<'hir>,
|
pub attrs: AttributeMap<'hir>,
|
||||||
/// Map indicating what traits are in scope for places where this
|
/// Map indicating what traits are in scope for places where this
|
||||||
/// is relevant; generated by resolve.
|
/// is relevant; generated by resolve.
|
||||||
pub trait_map: FxHashMap<ItemLocalId, Box<[TraitCandidate]>>,
|
pub trait_map: ItemLocalMap<Box<[TraitCandidate]>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> OwnerInfo<'tcx> {
|
impl<'tcx> OwnerInfo<'tcx> {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use crate::def::{CtorOf, DefKind, Res};
|
use crate::def::{CtorOf, DefKind, Res};
|
||||||
use crate::def_id::DefId;
|
use crate::def_id::{DefId, DefIdSet};
|
||||||
use crate::hir::{self, BindingAnnotation, ByRef, HirId, PatKind};
|
use crate::hir::{self, BindingAnnotation, ByRef, HirId, PatKind};
|
||||||
use rustc_data_structures::fx::FxHashSet;
|
|
||||||
use rustc_span::symbol::Ident;
|
use rustc_span::symbol::Ident;
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
|
|
||||||
@ -114,9 +113,9 @@ impl hir::Pat<'_> {
|
|||||||
}
|
}
|
||||||
_ => true,
|
_ => true,
|
||||||
});
|
});
|
||||||
// We remove duplicates by inserting into a `FxHashSet` to avoid re-ordering
|
// We remove duplicates by inserting into a hash set to avoid re-ordering
|
||||||
// the bounds
|
// the bounds
|
||||||
let mut duplicates = FxHashSet::default();
|
let mut duplicates = DefIdSet::default();
|
||||||
variants.retain(|def_id| duplicates.insert(*def_id));
|
variants.retain(|def_id| duplicates.insert(*def_id));
|
||||||
variants
|
variants
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use rustc_data_structures::unhash::UnhashMap;
|
|||||||
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
use rustc_expand::base::{SyntaxExtension, SyntaxExtensionKind};
|
||||||
use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, DeriveProcMacro};
|
use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, DeriveProcMacro};
|
||||||
use rustc_hir::def::Res;
|
use rustc_hir::def::Res;
|
||||||
use rustc_hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE};
|
use rustc_hir::def_id::{DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||||
use rustc_hir::definitions::{DefPath, DefPathData};
|
use rustc_hir::definitions::{DefPath, DefPathData};
|
||||||
use rustc_hir::diagnostic_items::DiagnosticItems;
|
use rustc_hir::diagnostic_items::DiagnosticItems;
|
||||||
use rustc_index::Idx;
|
use rustc_index::Idx;
|
||||||
@ -1200,7 +1200,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
|||||||
|
|
||||||
/// Iterates over the diagnostic items in the given crate.
|
/// Iterates over the diagnostic items in the given crate.
|
||||||
fn get_diagnostic_items(self) -> DiagnosticItems {
|
fn get_diagnostic_items(self) -> DiagnosticItems {
|
||||||
let mut id_to_name = FxHashMap::default();
|
let mut id_to_name = DefIdMap::default();
|
||||||
let name_to_id = self
|
let name_to_id = self
|
||||||
.root
|
.root
|
||||||
.diagnostic_items
|
.diagnostic_items
|
||||||
|
@ -69,7 +69,7 @@ use rustc_hir::def_id::{
|
|||||||
CrateNum, DefId, DefIdMap, DefIdSet, LocalDefId, LocalDefIdMap, LocalDefIdSet, LocalModDefId,
|
CrateNum, DefId, DefIdMap, DefIdSet, LocalDefId, LocalDefIdMap, LocalDefIdSet, LocalModDefId,
|
||||||
};
|
};
|
||||||
use rustc_hir::lang_items::{LangItem, LanguageItems};
|
use rustc_hir::lang_items::{LangItem, LanguageItems};
|
||||||
use rustc_hir::{Crate, ItemLocalId, TraitCandidate};
|
use rustc_hir::{Crate, ItemLocalId, ItemLocalMap, TraitCandidate};
|
||||||
use rustc_index::IndexVec;
|
use rustc_index::IndexVec;
|
||||||
use rustc_query_system::ich::StableHashingContext;
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_query_system::query::{try_get_cached, CacheSelector, QueryCache, QueryMode, QueryState};
|
use rustc_query_system::query::{try_get_cached, CacheSelector, QueryCache, QueryMode, QueryState};
|
||||||
@ -1490,7 +1490,7 @@ rustc_queries! {
|
|||||||
desc { "computing whether impls specialize one another" }
|
desc { "computing whether impls specialize one another" }
|
||||||
}
|
}
|
||||||
query in_scope_traits_map(_: hir::OwnerId)
|
query in_scope_traits_map(_: hir::OwnerId)
|
||||||
-> Option<&'tcx FxHashMap<ItemLocalId, Box<[TraitCandidate]>>> {
|
-> Option<&'tcx ItemLocalMap<Box<[TraitCandidate]>>> {
|
||||||
desc { "getting traits in scope at a block" }
|
desc { "getting traits in scope at a block" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ pub struct ResolverAstLowering {
|
|||||||
|
|
||||||
pub next_node_id: ast::NodeId,
|
pub next_node_id: ast::NodeId,
|
||||||
|
|
||||||
pub node_id_to_def_id: FxHashMap<ast::NodeId, LocalDefId>,
|
pub node_id_to_def_id: NodeMap<LocalDefId>,
|
||||||
pub def_id_to_node_id: IndexVec<LocalDefId, ast::NodeId>,
|
pub def_id_to_node_id: IndexVec<LocalDefId, ast::NodeId>,
|
||||||
|
|
||||||
pub trait_map: NodeMap<Vec<hir::TraitCandidate>>,
|
pub trait_map: NodeMap<Vec<hir::TraitCandidate>>,
|
||||||
|
@ -83,9 +83,6 @@ fn all_diagnostic_items(tcx: TyCtxt<'_>, (): ()) -> DiagnosticItems {
|
|||||||
|
|
||||||
// Collect diagnostic items in other crates.
|
// Collect diagnostic items in other crates.
|
||||||
for &cnum in tcx.crates(()).iter().chain(std::iter::once(&LOCAL_CRATE)) {
|
for &cnum in tcx.crates(()).iter().chain(std::iter::once(&LOCAL_CRATE)) {
|
||||||
// We are collecting many DiagnosticItems hash maps into one
|
|
||||||
// DiagnosticItems hash map. The iteration order does not matter.
|
|
||||||
#[allow(rustc::potential_query_instability)]
|
|
||||||
for (&name, &def_id) in &tcx.diagnostic_items(cnum).name_to_id {
|
for (&name, &def_id) in &tcx.diagnostic_items(cnum).name_to_id {
|
||||||
collect_item(tcx, &mut items, name, def_id);
|
collect_item(tcx, &mut items, name, def_id);
|
||||||
}
|
}
|
||||||
|
@ -1084,7 +1084,7 @@ pub struct Resolver<'a, 'tcx> {
|
|||||||
|
|
||||||
next_node_id: NodeId,
|
next_node_id: NodeId,
|
||||||
|
|
||||||
node_id_to_def_id: FxHashMap<ast::NodeId, LocalDefId>,
|
node_id_to_def_id: NodeMap<LocalDefId>,
|
||||||
def_id_to_node_id: IndexVec<LocalDefId, ast::NodeId>,
|
def_id_to_node_id: IndexVec<LocalDefId, ast::NodeId>,
|
||||||
|
|
||||||
/// Indices of unnamed struct or variant fields with unresolved attributes.
|
/// Indices of unnamed struct or variant fields with unresolved attributes.
|
||||||
@ -1296,7 +1296,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||||||
|
|
||||||
let mut def_id_to_node_id = IndexVec::default();
|
let mut def_id_to_node_id = IndexVec::default();
|
||||||
assert_eq!(def_id_to_node_id.push(CRATE_NODE_ID), CRATE_DEF_ID);
|
assert_eq!(def_id_to_node_id.push(CRATE_NODE_ID), CRATE_DEF_ID);
|
||||||
let mut node_id_to_def_id = FxHashMap::default();
|
let mut node_id_to_def_id = NodeMap::default();
|
||||||
node_id_to_def_id.insert(CRATE_NODE_ID, CRATE_DEF_ID);
|
node_id_to_def_id.insert(CRATE_NODE_ID, CRATE_DEF_ID);
|
||||||
|
|
||||||
let mut invocation_parents = FxHashMap::default();
|
let mut invocation_parents = FxHashMap::default();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user