Skip to content

Commit 14f89de

Browse files
committed
{rustc::hir::map -> rustc_hir}::definitions
1 parent bb8785e commit 14f89de

File tree

13 files changed

+23
-18
lines changed

13 files changed

+23
-18
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -3726,6 +3726,7 @@ name = "rustc_hir"
37263726
version = "0.0.0"
37273727
dependencies = [
37283728
"lazy_static 1.4.0",
3729+
"log",
37293730
"rustc_ast",
37303731
"rustc_ast_pretty",
37313732
"rustc_data_structures",

src/librustc/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ macro_rules! arena_types {
122122

123123
// HIR query types
124124
[few] indexed_hir: rustc::hir::map::IndexedHir<$tcx>,
125-
[few] hir_definitions: rustc::hir::map::definitions::Definitions,
125+
[few] hir_definitions: rustc_hir::definitions::Definitions,
126126
[] hir_owner: rustc::hir::Owner<$tcx>,
127127
[] hir_owner_nodes: rustc::hir::OwnerNodes<$tcx>,
128128
], $tcx);

src/librustc/hir/map/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
use self::collector::NodeCollector;
2-
pub use self::definitions::{
3-
DefKey, DefPath, DefPathData, DefPathHash, Definitions, DisambiguatedDefPathData,
4-
};
52

63
use crate::hir::{Owner, OwnerNodes};
74
use crate::ty::query::Providers;
@@ -10,6 +7,9 @@ use rustc_ast::ast::{self, Name, NodeId};
107
use rustc_data_structures::svh::Svh;
118
use rustc_hir::def::{DefKind, Res};
129
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
10+
pub use rustc_hir::definitions;
11+
pub use rustc_hir::definitions::{DefKey, DefPath, DefPathData, DefPathHash};
12+
pub use rustc_hir::definitions::{Definitions, DisambiguatedDefPathData};
1313
use rustc_hir::intravisit;
1414
use rustc_hir::itemlikevisit::ItemLikeVisitor;
1515
use rustc_hir::print::Nested;
@@ -23,7 +23,6 @@ use rustc_target::spec::abi::Abi;
2323

2424
pub mod blocks;
2525
mod collector;
26-
pub mod definitions;
2726
mod hir_id_validator;
2827
pub use hir_id_validator::check_crate;
2928

src/librustc_ast_lowering/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(specialization)]
3737
#![recursion_limit = "256"]
3838

39-
use rustc::hir::map::definitions::{DefKey, DefPathData, Definitions};
4039
use rustc_ast::ast;
4140
use rustc_ast::ast::*;
4241
use rustc_ast::attr;
@@ -53,6 +52,7 @@ use rustc_errors::struct_span_err;
5352
use rustc_hir as hir;
5453
use rustc_hir::def::{DefKind, Namespace, PartialRes, PerNS, Res};
5554
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX};
55+
use rustc_hir::definitions::{DefKey, DefPathData, Definitions};
5656
use rustc_hir::intravisit;
5757
use rustc_hir::{ConstArg, GenericArg, ParamName};
5858
use rustc_index::vec::IndexVec;

src/librustc_hir/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ rustc_errors = { path = "../librustc_errors" }
2020
rustc_serialize = { path = "../libserialize", package = "serialize" }
2121
rustc_ast = { path = "../librustc_ast" }
2222
lazy_static = "1"
23+
log = { version = "0.4", features = ["release_max_level_info", "std"] }
2324
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc/hir/map/definitions.rs renamed to src/librustc_hir/definitions.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
//! There are also some rather random cases (like const initializer
55
//! expressions) that are mostly just leftovers.
66
7+
pub use crate::def_id::DefPathHash;
8+
use crate::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
9+
use crate::hir;
10+
use crate::hir_id::DUMMY_HIR_ID;
11+
712
use rustc_ast::ast;
813
use rustc_ast::crate_disambiguator::CrateDisambiguator;
914
use rustc_data_structures::fx::FxHashMap;
1015
use rustc_data_structures::stable_hasher::StableHasher;
11-
use rustc_hir as hir;
12-
pub use rustc_hir::def_id::DefPathHash;
13-
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
1416
use rustc_index::vec::IndexVec;
1517
use rustc_span::hygiene::ExpnId;
1618
use rustc_span::symbol::{sym, Symbol};
1719
use rustc_span::Span;
1820

21+
use log::debug;
1922
use std::fmt::Write;
2023
use std::hash::Hash;
2124

@@ -344,7 +347,7 @@ impl Definitions {
344347
pub fn as_local_hir_id(&self, def_id: DefId) -> Option<hir::HirId> {
345348
if let Some(def_id) = def_id.as_local() {
346349
let hir_id = self.local_def_id_to_hir_id(def_id);
347-
if hir_id != hir::DUMMY_HIR_ID { Some(hir_id) } else { None }
350+
if hir_id != DUMMY_HIR_ID { Some(hir_id) } else { None }
348351
} else {
349352
None
350353
}

src/librustc_hir/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extern crate rustc_data_structures;
1515

1616
mod arena;
1717
pub mod def;
18+
pub mod definitions;
1819
pub use rustc_span::def_id;
1920
mod hir;
2021
pub mod hir_id;

src/librustc_lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use self::TargetLint::*;
1818

1919
use crate::levels::LintLevelsBuilder;
2020
use crate::passes::{EarlyLintPassObject, LateLintPassObject};
21-
use rustc::hir::map::definitions::{DefPathData, DisambiguatedDefPathData};
2221
use rustc::lint::LintDiagnosticBuilder;
2322
use rustc::middle::privacy::AccessLevels;
2423
use rustc::middle::stability;
@@ -31,6 +30,7 @@ use rustc_data_structures::sync;
3130
use rustc_errors::{struct_span_err, Applicability};
3231
use rustc_hir as hir;
3332
use rustc_hir::def_id::{CrateNum, DefId};
33+
use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
3434
use rustc_session::lint::{add_elided_lifetime_in_path_suggestion, BuiltinLintDiagnostics};
3535
use rustc_session::lint::{FutureIncompatibleInfo, Level, Lint, LintBuffer, LintId};
3636
use rustc_session::Session;

src/librustc_metadata/rmeta/decoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use crate::rmeta::*;
66

77
use rustc::dep_graph::{self, DepNode, DepNodeIndex};
88
use rustc::hir::exports::Export;
9-
use rustc::hir::map::definitions::DefPathTable;
10-
use rustc::hir::map::{DefKey, DefPath, DefPathData, DefPathHash};
119
use rustc::middle::cstore::{CrateSource, ExternCrate};
1210
use rustc::middle::cstore::{ForeignModule, LinkagePreference, NativeLibrary};
1311
use rustc::middle::exported_symbols::{ExportedSymbol, SymbolExportLevel};
@@ -29,6 +27,8 @@ use rustc_expand::proc_macro::{AttrProcMacro, BangProcMacro, ProcMacroDerive};
2927
use rustc_hir as hir;
3028
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
3129
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
30+
use rustc_hir::definitions::DefPathTable;
31+
use rustc_hir::definitions::{DefKey, DefPath, DefPathData, DefPathHash};
3232
use rustc_index::vec::{Idx, IndexVec};
3333
use rustc_serialize::{opaque, Decodable, Decoder, SpecializedDecoder};
3434
use rustc_session::Session;

src/librustc_metadata/rmeta/decoder/cstore_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use crate::native_libs;
55
use crate::rmeta::{self, encoder};
66

77
use rustc::hir::exports::Export;
8-
use rustc::hir::map::definitions::DefPathTable;
9-
use rustc::hir::map::{DefKey, DefPath, DefPathHash};
108
use rustc::middle::cstore::{CrateSource, CrateStore, EncodedMetadata, NativeLibraryKind};
119
use rustc::middle::exported_symbols::ExportedSymbol;
1210
use rustc::middle::stability::DeprecationEntry;
@@ -19,6 +17,8 @@ use rustc_ast::expand::allocator::AllocatorKind;
1917
use rustc_data_structures::svh::Svh;
2018
use rustc_hir as hir;
2119
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE};
20+
use rustc_hir::definitions::DefPathTable;
21+
use rustc_hir::definitions::{DefKey, DefPath, DefPathHash};
2222
use rustc_session::{CrateDisambiguator, Session};
2323
use rustc_span::source_map::{self, Span, Spanned};
2424
use rustc_span::symbol::Symbol;

src/librustc_metadata/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::rmeta::table::FixedSizeEncoding;
22
use crate::rmeta::*;
33

44
use log::{debug, trace};
5-
use rustc::hir::map::definitions::DefPathTable;
65
use rustc::hir::map::Map;
76
use rustc::middle::cstore::{EncodedMetadata, ForeignModule, LinkagePreference, NativeLibrary};
87
use rustc::middle::dependency_format::Linkage;
@@ -23,6 +22,7 @@ use rustc_hir as hir;
2322
use rustc_hir::def::CtorKind;
2423
use rustc_hir::def_id::DefIdSet;
2524
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
25+
use rustc_hir::definitions::DefPathTable;
2626
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
2727
use rustc_hir::itemlikevisit::{ItemLikeVisitor, ParItemLikeVisitor};
2828
use rustc_hir::{AnonConst, GenericParamKind};

src/librustc_resolve/def_collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use log::debug;
2-
use rustc::hir::map::definitions::*;
32
use rustc_ast::ast::*;
43
use rustc_ast::token::{self, Token};
54
use rustc_ast::visit::{self, FnKind};
65
use rustc_expand::expand::AstFragment;
76
use rustc_hir::def_id::LocalDefId;
7+
use rustc_hir::definitions::*;
88
use rustc_span::hygiene::ExpnId;
99
use rustc_span::symbol::{kw, sym};
1010
use rustc_span::Span;

src/librustc_traits/lowering/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
mod environment;
22

3-
use rustc::hir::map::definitions::DefPathData;
43
use rustc::hir::map::Map;
54
use rustc::traits::{
65
Clause, Clauses, DomainGoal, FromEnv, GoalKind, PolyDomainGoal, ProgramClause,
@@ -13,6 +12,7 @@ use rustc_ast::ast;
1312
use rustc_hir as hir;
1413
use rustc_hir::def::DefKind;
1514
use rustc_hir::def_id::DefId;
15+
use rustc_hir::definitions::DefPathData;
1616
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
1717
use rustc_span::symbol::sym;
1818

0 commit comments

Comments
 (0)