Move the untracked cstore and source_span into a struct

This commit is contained in:
Oli Scherer
2022-12-07 14:31:50 +00:00
parent 2cd36f2c89
commit 1c1d3570ee
16 changed files with 78 additions and 91 deletions

View File

@@ -46,7 +46,7 @@ use rustc_index::vec::IndexVec;
use rustc_macros::HashStable;
use rustc_query_system::ich::StableHashingContext;
use rustc_serialize::{Decodable, Encodable};
use rustc_session::cstore::CrateStoreDyn;
use rustc_session::cstore::Untracked;
use rustc_span::hygiene::MacroKind;
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{ExpnId, Span};
@@ -153,18 +153,16 @@ pub struct ResolverOutputs {
pub definitions: Definitions,
pub global_ctxt: ResolverGlobalCtxt,
pub ast_lowering: ResolverAstLowering,
pub untracked: Untracked,
}
#[derive(Debug)]
pub struct ResolverGlobalCtxt {
pub cstore: Box<CrateStoreDyn>,
pub visibilities: FxHashMap<LocalDefId, Visibility>,
/// This field is used to decide whether we should make `PRIVATE_IN_PUBLIC` a hard error.
pub has_pub_restricted: bool,
/// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`.
pub expn_that_defined: FxHashMap<LocalDefId, ExpnId>,
/// Reference span for definitions.
pub source_span: IndexVec<LocalDefId, Span>,
pub effective_visibilities: EffectiveVisibilities,
pub extern_crate_map: FxHashMap<LocalDefId, CrateNum>,
pub maybe_unused_trait_imports: FxIndexSet<LocalDefId>,