move Node{Map,Set} -> rustc_session::node_id

This commit is contained in:
Mazdak Farrokhzad 2019-12-24 22:42:56 +01:00
parent f507403517
commit 5ccc1e45bd
14 changed files with 21 additions and 14 deletions

View File

@ -3368,6 +3368,7 @@ dependencies = [
"rustc_error_codes",
"rustc_errors",
"rustc_index",
"rustc_session",
"rustc_span",
"rustc_target",
"smallvec 1.0.0",
@ -3808,6 +3809,7 @@ dependencies = [
"rustc_expand",
"rustc_feature",
"rustc_metadata",
"rustc_session",
"rustc_span",
"smallvec 1.0.0",
"syntax",

View File

@ -7,12 +7,12 @@
use crate::hir;
use crate::hir::def_id::{CrateNum, DefId, DefIndex, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::ich::Fingerprint;
use crate::session::CrateDisambiguator;
use crate::util::nodemap::NodeMap;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher;
use rustc_index::vec::IndexVec;
use rustc_session::node_id::NodeMap;
use rustc_session::CrateDisambiguator;
use rustc_span::hygiene::ExpnId;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;

View File

@ -11,13 +11,13 @@ pub use self::UnsafeSource::*;
use crate::hir::def::{DefKind, Res};
use crate::hir::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX};
use crate::ty::query::Providers;
use crate::util::nodemap::NodeMap;
use errors::FatalError;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::{par_for_each_in, Send, Sync};
use rustc_macros::HashStable;
use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder};
use rustc_session::node_id::NodeMap;
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::{MultiSpan, Span, DUMMY_SP};

View File

@ -25,10 +25,10 @@ use rustc_data_structures::sync;
use crate::hir;
use crate::lint::builtin::BuiltinLintDiagnostics;
use crate::session::{DiagnosticMessageId, Session};
use crate::ty::TyCtxt;
use crate::util::nodemap::NodeMap;
use errors::{DiagnosticBuilder, DiagnosticId};
use rustc_session::node_id::NodeMap;
use rustc_session::{DiagnosticMessageId, Session};
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use rustc_span::symbol::Symbol;

View File

@ -46,7 +46,7 @@ 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::{DefIdMap, DefIdSet, ItemLocalMap, ItemLocalSet, NodeMap};
use crate::util::nodemap::{DefIdMap, DefIdSet, ItemLocalMap, ItemLocalSet};
use arena::SyncDroplessArena;
use errors::DiagnosticBuilder;
@ -59,6 +59,7 @@ use rustc_data_structures::stable_hasher::{
use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable;
use rustc_session::node_id::NodeMap;
use rustc_span::source_map::MultiSpan;
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;

View File

@ -28,11 +28,12 @@ use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
use crate::ty::util::{Discr, IntTypeExt};
use crate::ty::walk::TypeWalker;
use crate::util::captures::Captures;
use crate::util::nodemap::{DefIdMap, NodeMap, NodeSet};
use crate::util::nodemap::DefIdMap;
use arena::SyncDroplessArena;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_macros::HashStable;
use rustc_session::node_id::{NodeMap, NodeSet};
use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator};
use rustc_serialize::{self, Encodable, Encoder};

View File

@ -2,11 +2,9 @@
use crate::hir::def_id::DefId;
use crate::hir::{HirId, ItemLocalId};
use syntax::ast;
use rustc_data_structures::define_id_collections;
define_id_collections!(NodeMap, NodeSet, ast::NodeId);
define_id_collections!(DefIdMap, DefIdSet, DefId);
define_id_collections!(HirIdMap, HirIdSet, HirId);
define_id_collections!(ItemLocalMap, ItemLocalSet, ItemLocalId);

View File

@ -18,5 +18,6 @@ rustc_index = { path = "../librustc_index" }
rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_errors = { path = "../librustc_errors" }
rustc_session = { path = "../librustc_session" }
syntax = { path = "../libsyntax" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

View File

@ -6,8 +6,8 @@ use rustc::bug;
use rustc::hir;
use rustc::hir::def::{DefKind, Res};
use rustc::hir::def_id::DefId;
use rustc::util::nodemap::NodeMap;
use rustc_error_codes::*;
use rustc_session::node_id::NodeMap;
use rustc_span::source_map::{respan, DesugaringKind};
use rustc_span::symbol::{kw, sym};
use rustc_span::Span;

View File

@ -47,13 +47,14 @@ use rustc::session::config::nightly_options;
use rustc::session::Session;
use rustc::util::captures::Captures;
use rustc::util::common::FN_OUTPUT_NAME;
use rustc::util::nodemap::{DefIdMap, NodeMap};
use rustc::util::nodemap::DefIdMap;
use rustc::{bug, span_bug};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;
use rustc_error_codes::*;
use rustc_errors::Applicability;
use rustc_index::vec::IndexVec;
use rustc_session::node_id::NodeMap;
use rustc_span::hygiene::ExpnId;
use rustc_span::source_map::{respan, DesugaringKind, ExpnData, ExpnKind, Spanned};
use rustc_span::symbol::{kw, sym, Symbol};

View File

@ -24,4 +24,5 @@ rustc_data_structures = { path = "../librustc_data_structures" }
rustc_feature = { path = "../librustc_feature" }
rustc_metadata = { path = "../librustc_metadata" }
rustc_error_codes = { path = "../librustc_error_codes" }
rustc_session = { path = "../librustc_session" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

View File

@ -27,10 +27,9 @@ use crate::imports::ImportDirectiveSubclass;
use crate::Resolver;
use errors::pluralize;
use rustc::util::nodemap::NodeMap;
use rustc::{lint, ty};
use rustc_data_structures::fx::FxHashSet;
use rustc_session::node_id::NodeMap;
use rustc_span::{MultiSpan, Span, DUMMY_SP};
use syntax::ast;
use syntax::visit::{self, Visitor};

View File

@ -33,12 +33,13 @@ use rustc::session::Session;
use rustc::span_bug;
use rustc::ty::query::Providers;
use rustc::ty::{self, DefIdTree, ResolverOutputs};
use rustc::util::nodemap::{DefIdMap, NodeMap, NodeSet};
use rustc::util::nodemap::DefIdMap;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
use rustc_data_structures::ptr_key::PtrKey;
use rustc_data_structures::sync::Lrc;
use rustc_expand::base::SyntaxExtension;
use rustc_metadata::creader::{CStore, CrateLoader};
use rustc_session::node_id::{NodeMap, NodeSet};
use rustc_span::hygiene::{ExpnId, ExpnKind, MacroKind, SyntaxContext, Transparency};
use rustc_span::source_map::Spanned;
use rustc_span::symbol::{kw, sym};

View File

@ -10,6 +10,8 @@ rustc_index::newtype_index! {
}
}
rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeId);
impl NodeId {
pub fn placeholder_from_expn_id(expn_id: ExpnId) -> Self {
NodeId::from_u32(expn_id.as_u32())