{HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemap

This commit is contained in:
Mazdak Farrokhzad 2019-12-25 00:22:24 +01:00
parent ca297f8cf4
commit 2f64ab6633
14 changed files with 16 additions and 34 deletions

View file

@ -44,7 +44,7 @@ macro_rules! arena_types {
[few, decode] mir_keys: rustc::hir::def_id::DefIdSet,
[decode] specialization_graph: rustc::traits::specialization_graph::Graph,
[] region_scope_tree: rustc::middle::region::ScopeTree,
[] item_local_set: rustc::util::nodemap::ItemLocalSet,
[] item_local_set: rustc::hir::ItemLocalSet,
[decode] mir_const_qualif: rustc_index::bit_set::BitSet<rustc::mir::Local>,
[] trait_impls_of: rustc::ty::trait_def::TraitImpls,
[] dropck_outlives:

View file

@ -93,6 +93,9 @@ impl fmt::Display for HirId {
}
}
rustc_data_structures::define_id_collections!(HirIdMap, HirIdSet, HirId);
rustc_data_structures::define_id_collections!(ItemLocalMap, ItemLocalSet, ItemLocalId);
// Hack to ensure that we don't try to access the private parts of `ItemLocalId` in this module.
mod item_local_id_inner {
use rustc_index::vec::Idx;

View file

@ -105,7 +105,6 @@ pub mod util {
pub mod bug;
pub mod captures;
pub mod common;
pub mod nodemap;
}
// Allows macros to refer to this crate as `::rustc`

View file

@ -7,7 +7,8 @@ use crate::hir::def::{DefKind, Export, Res};
use crate::hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex, LOCAL_CRATE};
use crate::hir::map as hir_map;
use crate::hir::map::DefPathHash;
use crate::hir::{self, HirId, ItemKind, ItemLocalId, Node, TraitCandidate};
use crate::hir::{self, HirId, Node, TraitCandidate};
use crate::hir::{ItemKind, ItemLocalId, ItemLocalMap, ItemLocalSet};
use crate::ich::{NodeIdHashingMode, StableHashingContext};
use crate::infer::canonical::{Canonical, CanonicalVarInfo, CanonicalVarInfos};
use crate::infer::outlives::free_region_map::FreeRegionMap;
@ -46,7 +47,6 @@ use crate::ty::{ExistentialPredicate, InferTy, ParamTy, PolyFnSig, Predicate, Pr
use crate::ty::{InferConst, ParamConst};
use crate::ty::{List, TyKind, TyS};
use crate::util::common::ErrorReported;
use crate::util::nodemap::{ItemLocalMap, ItemLocalSet};
use arena::SyncDroplessArena;
use errors::DiagnosticBuilder;

View file

@ -1,7 +1,7 @@
use crate::dep_graph::{self, DepNode};
use crate::hir::def::{DefKind, Export};
use crate::hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex};
use crate::hir::{self, ItemLocalId, TraitCandidate};
use crate::hir::{self, HirIdSet, ItemLocalId, TraitCandidate};
use crate::infer::canonical::{self, Canonical};
use crate::lint;
use crate::middle::codegen_fn_attrs::CodegenFnAttrs;
@ -37,7 +37,6 @@ use crate::ty::subst::SubstsRef;
use crate::ty::util::NeedsDrop;
use crate::ty::{self, AdtSizedConstraint, CrateInherentImpls, ParamEnvAnd, Ty, TyCtxt};
use crate::util::common::ErrorReported;
use crate::util::nodemap::HirIdSet;
use rustc_data_structures::profiling::ProfileCategory::*;
use rustc_data_structures::fingerprint::Fingerprint;

View file

@ -1,8 +0,0 @@
//! An efficient hash map for `NodeId`s.
use crate::hir::{HirId, ItemLocalId};
use rustc_data_structures::define_id_collections;
define_id_collections!(HirIdMap, HirIdSet, HirId);
define_id_collections!(ItemLocalMap, ItemLocalSet, ItemLocalId);

View file

@ -23,15 +23,14 @@
use std::fmt::Write;
use hir::Node;
use lint::{EarlyContext, EarlyLintPass, LateLintPass, LintPass};
use lint::{LateContext, LintArray, LintContext};
use rustc::hir::def::{DefKind, Res};
use rustc::hir::def_id::DefId;
use rustc::hir::{HirIdSet, Node};
use rustc::lint;
use rustc::lint::FutureIncompatibleInfo;
use rustc::ty::{self, layout::VariantIdx, Ty, TyCtxt};
use rustc::{lint, util};
use util::nodemap::HirIdSet;
use rustc_data_structures::fx::FxHashSet;
use rustc_feature::Stability;

View file

@ -4,15 +4,13 @@ use crate::hair::cx::Cx;
use crate::hair::{BindingMode, LintLevel, PatKind};
use crate::transform::MirSource;
use crate::util as mir_util;
use rustc::hir;
use rustc::hir::def_id::DefId;
use rustc::hir::{GeneratorKind, Node};
use rustc::hir::{self, GeneratorKind, HirIdMap, Node};
use rustc::middle::lang_items;
use rustc::middle::region;
use rustc::mir::*;
use rustc::ty::subst::Subst;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::util::nodemap::HirIdMap;
use rustc_index::vec::{Idx, IndexVec};
use rustc_span::symbol::kw;
use rustc_span::Span;

View file

@ -96,16 +96,13 @@
use self::LiveNodeKind::*;
use self::VarKind::*;
use rustc::hir;
use rustc::hir::def::*;
use rustc::hir::def_id::DefId;
use rustc::hir::intravisit::{self, FnKind, NestedVisitorMap, Visitor};
use rustc::hir::Node;
use rustc::hir::{Expr, HirId};
use rustc::hir::{self, Expr, HirId, HirIdMap, HirIdSet, Node};
use rustc::lint;
use rustc::ty::query::Providers;
use rustc::ty::{self, TyCtxt};
use rustc::util::nodemap::{HirIdMap, HirIdSet};
use errors::Applicability;
use rustc_data_structures::fx::FxIndexMap;

View file

@ -5,7 +5,6 @@
// makes all other generics or inline functions that it references
// reachable as well.
use rustc::hir;
use rustc::hir::def::{DefKind, Res};
use rustc::hir::def_id::LOCAL_CRATE;
use rustc::hir::def_id::{CrateNum, DefId};
@ -13,12 +12,12 @@ use rustc::hir::intravisit;
use rustc::hir::intravisit::{NestedVisitorMap, Visitor};
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::Node;
use rustc::hir::{self, HirIdSet};
use rustc::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc::middle::privacy;
use rustc::session::config;
use rustc::ty::query::Providers;
use rustc::ty::{self, TyCtxt};
use rustc::util::nodemap::HirIdSet;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;
use rustc_target::spec::abi::Abi;

View file

@ -11,14 +11,13 @@ use rustc::hir::def::{DefKind, Res};
use rustc::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::hir::itemlikevisit::DeepVisitor;
use rustc::hir::{self, AssocItemKind, Node, PatKind};
use rustc::hir::{self, AssocItemKind, HirIdSet, Node, PatKind};
use rustc::lint;
use rustc::middle::privacy::{AccessLevel, AccessLevels};
use rustc::ty::fold::TypeVisitor;
use rustc::ty::query::Providers;
use rustc::ty::subst::InternalSubsts;
use rustc::ty::{self, GenericParamDefKind, TraitRef, Ty, TyCtxt, TypeFoldable};
use rustc::util::nodemap::HirIdSet;
use rustc_data_structures::fx::FxHashSet;
use rustc_span::hygiene::Transparency;
use rustc_span::symbol::{kw, sym};

View file

@ -10,13 +10,12 @@ use rustc::hir::def::{DefKind, Res};
use rustc::hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LOCAL_CRATE};
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::hir::map::Map;
use rustc::hir::{self, GenericParamKind, LifetimeParamKind};
use rustc::hir::{self, GenericParamKind, HirIdMap, HirIdSet, LifetimeParamKind};
use rustc::hir::{GenericArg, GenericParam, LifetimeName, Node, ParamName, QPath};
use rustc::lint;
use rustc::middle::resolve_lifetime::*;
use rustc::session::Session;
use rustc::ty::{self, DefIdTree, GenericParamDefKind, TyCtxt};
use rustc::util::nodemap::{HirIdMap, HirIdSet};
use rustc::{bug, span_bug};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_span::symbol::{kw, sym};

View file

@ -95,7 +95,7 @@ use rustc::hir::def::{CtorOf, DefKind, Res};
use rustc::hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, LOCAL_CRATE};
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::{self, ExprKind, GenericArg, ItemKind, Node, PatKind, QPath};
use rustc::hir::{self, ExprKind, GenericArg, HirIdMap, ItemKind, Node, PatKind, QPath};
use rustc::infer::canonical::{Canonical, OriginalQueryValues, QueryResponse};
use rustc::infer::error_reporting::TypeAnnotationNeeded::E0282;
use rustc::infer::opaque_types::OpaqueTypeDecl;
@ -145,7 +145,6 @@ use crate::session::config::EntryFnType;
use crate::session::Session;
use crate::util::captures::Captures;
use crate::util::common::{indenter, ErrorReported};
use crate::util::nodemap::HirIdMap;
use crate::TypeAndSubsts;
use self::autoderef::Autoderef;

View file

@ -9,10 +9,9 @@
// `InferredIndex` is a newtype'd int representing the index of such
// a variable.
use crate::util::nodemap::HirIdMap;
use arena::TypedArena;
use rustc::hir;
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::hir::{self, HirIdMap};
use rustc::ty::{self, TyCtxt};
use std::fmt;