diff options
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 12 |
3 files changed, 10 insertions, 13 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 8c20e71e26a..aefae3a3b14 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -195,7 +195,6 @@ rustc_queries! { } query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt { - no_hash desc { "getting the resolver outputs" } } diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index efa47b57cf3..8aa50d14faa 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2058,9 +2058,8 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn iter_local_def_id(self) -> impl Iterator<Item = LocalDefId> { - // Create a dependency to the red node to be sure we re-execute this when the amount of - // definitions change. - self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE); + // Depend on the `analysis` query to ensure compilation if finished. + self.ensure_ok().analysis(()); let definitions = &self.untracked.definitions; gen { @@ -2080,9 +2079,8 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn def_path_table(self) -> &'tcx rustc_hir::definitions::DefPathTable { - // Create a dependency to the crate to be sure we re-execute this when the amount of - // definitions change. - self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE); + // Depend on the `analysis` query to ensure compilation if finished. + self.ensure_ok().analysis(()); // Freeze definitions once we start iterating on them, to prevent adding new ones // while iterating. If some query needs to add definitions, it should be `ensure`d above. diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 84b21fee92f..7f79cd5d468 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -33,7 +33,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; use rustc_data_structures::intern::Interned; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::steal::Steal; -use rustc_data_structures::unord::UnordMap; +use rustc_data_structures::unord::{UnordMap, UnordSet}; use rustc_errors::{Diag, ErrorGuaranteed}; use rustc_hir::LangItem; use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res}; @@ -176,11 +176,11 @@ pub struct ResolverOutputs { pub ast_lowering: ResolverAstLowering, } -#[derive(Debug)] +#[derive(Debug, HashStable)] pub struct ResolverGlobalCtxt { pub visibilities_for_hashing: Vec<(LocalDefId, Visibility)>, /// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`. - pub expn_that_defined: FxHashMap<LocalDefId, ExpnId>, + pub expn_that_defined: UnordMap<LocalDefId, ExpnId>, pub effective_visibilities: EffectiveVisibilities, pub extern_crate_map: UnordMap<LocalDefId, CrateNum>, pub maybe_unused_trait_imports: FxIndexSet<LocalDefId>, @@ -196,8 +196,8 @@ pub struct ResolverGlobalCtxt { pub confused_type_with_std_module: FxIndexMap<Span, Span>, pub doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>, pub doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>, - pub all_macro_rules: FxHashSet<Symbol>, - pub stripped_cfg_items: Steal<Vec<StrippedCfgItem>>, + pub all_macro_rules: UnordSet<Symbol>, + pub stripped_cfg_items: Vec<StrippedCfgItem>, } /// Resolutions that should only be used for lowering. @@ -243,7 +243,7 @@ pub struct DelegationFnSig { pub target_feature: bool, } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, HashStable)] pub struct MainDefinition { pub res: Res<ast::NodeId>, pub is_import: bool, |
