Skip to content

Commit 45c8c56

Browse files
committed
rustc: rename TyCtxt's map field to hir.
1 parent 2f0463a commit 45c8c56

File tree

111 files changed

+761
-761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+761
-761
lines changed

src/librustc/cfg/construct.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ pub fn construct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
4646
// Find the function this expression is from.
4747
let mut node_id = body.id;
4848
loop {
49-
let node = tcx.map.get(node_id);
49+
let node = tcx.hir.get(node_id);
5050
if hir::map::blocks::FnLikeNode::from_node(node).is_some() {
5151
break;
5252
}
53-
let parent = tcx.map.get_parent_node(node_id);
53+
let parent = tcx.hir.get_parent_node(node_id);
5454
assert!(node_id != parent);
5555
node_id = parent;
5656
}
5757

5858
let mut cfg_builder = CFGBuilder {
5959
tcx: tcx,
60-
tables: tcx.item_tables(tcx.map.local_def_id(node_id)),
60+
tables: tcx.item_tables(tcx.hir.local_def_id(node_id)),
6161
graph: graph,
6262
fn_exit: fn_exit,
6363
loop_scopes: Vec::new()

src/librustc/dep_graph/dep_node.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ pub enum DepNode<D: Clone + Debug> {
2929
// Represents the `Krate` as a whole (the `hir::Krate` value) (as
3030
// distinct from the krate module). This is basically a hash of
3131
// the entire krate, so if you read from `Krate` (e.g., by calling
32-
// `tcx.map.krate()`), we will have to assume that any change
32+
// `tcx.hir.krate()`), we will have to assume that any change
3333
// means that you need to be recompiled. This is because the
3434
// `Krate` value gives you access to all other items. To avoid
35-
// this fate, do not call `tcx.map.krate()`; instead, prefer
35+
// this fate, do not call `tcx.hir.krate()`; instead, prefer
3636
// wrappers like `tcx.visit_all_items_in_krate()`. If there is no
3737
// suitable wrapper, you can use `tcx.dep_graph.ignore()` to gain
3838
// access to the krate, but you must remember to add suitable

src/librustc/dep_graph/dep_tracking_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<M: DepTrackingMapConfig> MemoizationMap for RefCell<DepTrackingMap<M>> {
117117
///
118118
/// ```
119119
/// fn type_of_item(..., item: &hir::Item) -> Ty<'tcx> {
120-
/// let item_def_id = ccx.tcx.map.local_def_id(it.id);
120+
/// let item_def_id = ccx.tcx.hir.local_def_id(it.id);
121121
/// ccx.tcx.item_types.memoized(item_def_id, || {
122122
/// ccx.tcx.dep_graph.read(DepNode::Hir(item_def_id)); // (*)
123123
/// compute_type_of_item(ccx, item)

src/librustc/dep_graph/visit.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
3636
where F: FnMut(DefId) -> DepNode<DefId>, V: ItemLikeVisitor<'tcx>
3737
{
3838
fn visit_item(&mut self, i: &'tcx hir::Item) {
39-
let item_def_id = self.tcx.map.local_def_id(i.id);
39+
let item_def_id = self.tcx.hir.local_def_id(i.id);
4040
let task_id = (self.dep_node_fn)(item_def_id);
4141
let _task = self.tcx.dep_graph.in_task(task_id.clone());
4242
debug!("Started task {:?}", task_id);
@@ -46,7 +46,7 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
4646
}
4747

4848
fn visit_trait_item(&mut self, i: &'tcx hir::TraitItem) {
49-
let trait_item_def_id = self.tcx.map.local_def_id(i.id);
49+
let trait_item_def_id = self.tcx.hir.local_def_id(i.id);
5050
let task_id = (self.dep_node_fn)(trait_item_def_id);
5151
let _task = self.tcx.dep_graph.in_task(task_id.clone());
5252
debug!("Started task {:?}", task_id);
@@ -56,7 +56,7 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
5656
}
5757

5858
fn visit_impl_item(&mut self, i: &'tcx hir::ImplItem) {
59-
let impl_item_def_id = self.tcx.map.local_def_id(i.id);
59+
let impl_item_def_id = self.tcx.hir.local_def_id(i.id);
6060
let task_id = (self.dep_node_fn)(impl_item_def_id);
6161
let _task = self.tcx.dep_graph.in_task(task_id.clone());
6262
debug!("Started task {:?}", task_id);
@@ -66,7 +66,7 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
6666
}
6767
}
6868

69-
let krate = tcx.dep_graph.with_ignore(|| tcx.map.krate());
69+
let krate = tcx.dep_graph.with_ignore(|| tcx.hir.krate());
7070
let mut tracking_visitor = TrackingVisitor {
7171
tcx: tcx,
7272
dep_node_fn: &mut dep_node_fn,

src/librustc/hir/itemlikevisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use super::intravisit::Visitor;
4444
/// - How: Implement `intravisit::Visitor` and override the
4545
/// `visit_nested_map()` methods to return
4646
/// `NestedVisitorMap::All`. Walk your crate with
47-
/// `intravisit::walk_crate()` invoked on `tcx.map.krate()`.
47+
/// `intravisit::walk_crate()` invoked on `tcx.hir.krate()`.
4848
/// - Pro: Visitor methods for any kind of HIR node, not just item-like things.
4949
/// - Pro: Preserves nesting information
5050
/// - Con: Does not integrate well into dependency tracking.

src/librustc/infer/error_reporting.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
144144
format!("{}unknown scope: {:?}{}. Please report a bug.",
145145
prefix, scope, suffix)
146146
};
147-
let span = match scope.span(&self.region_maps, &self.map) {
147+
let span = match scope.span(&self.region_maps, &self.hir) {
148148
Some(s) => s,
149149
None => {
150150
err.note(&unknown_scope());
151151
return;
152152
}
153153
};
154-
let tag = match self.map.find(scope.node_id(&self.region_maps)) {
154+
let tag = match self.hir.find(scope.node_id(&self.region_maps)) {
155155
Some(ast_map::NodeBlock(_)) => "block",
156156
Some(ast_map::NodeExpr(expr)) => match expr.node {
157157
hir::ExprCall(..) => "call",
@@ -206,7 +206,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
206206

207207
let node = fr.scope.node_id(&self.region_maps);
208208
let unknown;
209-
let tag = match self.map.find(node) {
209+
let tag = match self.hir.find(node) {
210210
Some(ast_map::NodeBlock(_)) |
211211
Some(ast_map::NodeExpr(_)) => "body",
212212
Some(ast_map::NodeItem(it)) => item_scope_tag(&it),
@@ -218,7 +218,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
218218
Some(_) => {
219219
unknown = format!("unexpected node ({}) for scope {:?}. \
220220
Please report a bug.",
221-
self.map.node_to_string(node), fr.scope);
221+
self.hir.node_to_string(node), fr.scope);
222222
&unknown
223223
}
224224
None => {
@@ -227,7 +227,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
227227
&unknown
228228
}
229229
};
230-
let (msg, opt_span) = explain_span(self, tag, self.map.span(node));
230+
let (msg, opt_span) = explain_span(self, tag, self.hir.span(node));
231231
(format!("{} {}", prefix, msg), opt_span)
232232
}
233233

@@ -467,8 +467,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
467467
},
468468
_ => return None
469469
};
470-
let parent = tcx.map.get_parent(scope_id);
471-
let parent_node = tcx.map.find(parent);
470+
let parent = tcx.hir.get_parent(scope_id);
471+
let parent_node = tcx.hir.find(parent);
472472
match parent_node {
473473
Some(node) => match node {
474474
ast_map::NodeItem(item) => match item.node {
@@ -1068,8 +1068,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10681068

10691069
fn give_suggestion(&self, err: &mut DiagnosticBuilder, same_regions: &[SameRegions]) {
10701070
let scope_id = same_regions[0].scope_id;
1071-
let parent = self.tcx.map.get_parent(scope_id);
1072-
let parent_node = self.tcx.map.find(parent);
1071+
let parent = self.tcx.hir.get_parent(scope_id);
1072+
let parent_node = self.tcx.hir.find(parent);
10731073
let taken = lifetimes_in_scope(self.tcx, scope_id);
10741074
let life_giver = LifeGiver::with_taken(&taken[..]);
10751075
let node_inner = match parent_node {
@@ -1083,8 +1083,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10831083
}
10841084
}
10851085
ast_map::NodeImplItem(item) => {
1086-
let id = self.tcx.map.get_parent(item.id);
1087-
if let Some(ast_map::NodeItem(parent_scope)) = self.tcx.map.find(id) {
1086+
let id = self.tcx.hir.get_parent(item.id);
1087+
if let Some(ast_map::NodeItem(parent_scope)) = self.tcx.hir.find(id) {
10881088
if let hir::ItemImpl(_, _, _, None, _, _) = parent_scope.node {
10891089
// this impl scope implements a trait, do not recomend
10901090
// using explicit lifetimes (#37363)
@@ -1654,7 +1654,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16541654
generics: &hir::Generics,
16551655
span: Span,
16561656
body: hir::BodyId) {
1657-
let s = hir::print::to_string(&self.tcx.map, |s| {
1657+
let s = hir::print::to_string(&self.tcx.hir, |s| {
16581658
use syntax::abi::Abi;
16591659
use syntax::print::pprust::PrintState;
16601660

@@ -1891,8 +1891,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
18911891
scope_id: ast::NodeId)
18921892
-> Vec<hir::LifetimeDef> {
18931893
let mut taken = Vec::new();
1894-
let parent = tcx.map.get_parent(scope_id);
1895-
let method_id_opt = match tcx.map.find(parent) {
1894+
let parent = tcx.hir.get_parent(scope_id);
1895+
let method_id_opt = match tcx.hir.find(parent) {
18961896
Some(node) => match node {
18971897
ast_map::NodeItem(item) => match item.node {
18981898
hir::ItemFn(.., ref gen, _) => {
@@ -1915,8 +1915,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
19151915
None => None
19161916
};
19171917
if let Some(method_id) = method_id_opt {
1918-
let parent = tcx.map.get_parent(method_id);
1919-
if let Some(node) = tcx.map.find(parent) {
1918+
let parent = tcx.hir.get_parent(method_id);
1919+
if let Some(node) = tcx.hir.find(parent) {
19201920
match node {
19211921
ast_map::NodeItem(item) => match item.node {
19221922
hir::ItemImpl(_, _, ref gen, ..) => {

src/librustc/infer/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
453453
-> (Option<&'a ty::TypeckTables<'tcx>>,
454454
Option<ty::TypeckTables<'tcx>>,
455455
Option<ty::ParameterEnvironment<'tcx>>) {
456-
let item_id = tcx.map.body_owner(self);
457-
(Some(tcx.item_tables(tcx.map.local_def_id(item_id))),
456+
let item_id = tcx.hir.body_owner(self);
457+
(Some(tcx.item_tables(tcx.hir.local_def_id(item_id))),
458458
None,
459459
Some(ty::ParameterEnvironment::for_item(tcx, item_id)))
460460
}
@@ -1269,7 +1269,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
12691269
self.tcx.types.err,
12701270
None => {
12711271
bug!("no type for node {}: {} in fcx",
1272-
id, self.tcx.map.node_to_string(id));
1272+
id, self.tcx.hir.node_to_string(id));
12731273
}
12741274
}
12751275
}
@@ -1639,7 +1639,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16391639
-> Option<ty::ClosureKind>
16401640
{
16411641
if let InferTables::InProgress(tables) = self.tables {
1642-
if let Some(id) = self.tcx.map.as_local_node_id(def_id) {
1642+
if let Some(id) = self.tcx.hir.as_local_node_id(def_id) {
16431643
return tables.borrow().closure_kinds.get(&id).cloned();
16441644
}
16451645
}
@@ -1657,7 +1657,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16571657
-> ty::ClosureTy<'tcx>
16581658
{
16591659
if let InferTables::InProgress(tables) = self.tables {
1660-
if let Some(id) = self.tcx.map.as_local_node_id(def_id) {
1660+
if let Some(id) = self.tcx.hir.as_local_node_id(def_id) {
16611661
if let Some(ty) = tables.borrow().closure_tys.get(&id) {
16621662
return ty.subst(self.tcx, substs.substs);
16631663
}

src/librustc/lint/context.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ impl<'a, 'tcx> hir_visit::Visitor<'tcx> for LateContext<'a, 'tcx> {
768768
/// items in the context of the outer item, so enable
769769
/// deep-walking.
770770
fn nested_visit_map<'this>(&'this mut self) -> hir_visit::NestedVisitorMap<'this, 'tcx> {
771-
hir_visit::NestedVisitorMap::All(&self.tcx.map)
771+
hir_visit::NestedVisitorMap::All(&self.tcx.hir)
772772
}
773773

774774
// Output any lints that were previously added to the session.
@@ -784,7 +784,7 @@ impl<'a, 'tcx> hir_visit::Visitor<'tcx> for LateContext<'a, 'tcx> {
784784
fn visit_nested_body(&mut self, body: hir::BodyId) {
785785
let old_tables = self.tables;
786786
self.tables = self.tcx.body_tables(body);
787-
let body = self.tcx.map.body(body);
787+
let body = self.tcx.hir.body(body);
788788
self.visit_body(body);
789789
self.tables = old_tables;
790790
}
@@ -834,7 +834,7 @@ impl<'a, 'tcx> hir_visit::Visitor<'tcx> for LateContext<'a, 'tcx> {
834834
// in order for `check_fn` to be able to use them.
835835
let old_tables = self.tables;
836836
self.tables = self.tcx.body_tables(body_id);
837-
let body = self.tcx.map.body(body_id);
837+
let body = self.tcx.hir.body(body_id);
838838
run_lints!(self, check_fn, late_passes, fk, decl, body, span, id);
839839
hir_visit::walk_fn(self, fk, decl, body_id, span, id);
840840
run_lints!(self, check_fn_post, late_passes, fk, decl, body, span, id);
@@ -1206,7 +1206,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12061206
access_levels: &AccessLevels) {
12071207
let _task = tcx.dep_graph.in_task(DepNode::LateLintCheck);
12081208

1209-
let krate = tcx.map.krate();
1209+
let krate = tcx.hir.krate();
12101210

12111211
// We want to own the lint store, so move it out of the session.
12121212
let lint_store = mem::replace(&mut *tcx.sess.lint_store.borrow_mut(), LintStore::new());
@@ -1236,7 +1236,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12361236
for early_lint in v {
12371237
span_bug!(early_lint.diagnostic.span.clone(),
12381238
"unprocessed lint {:?} at {}",
1239-
early_lint, tcx.map.node_to_string(*id));
1239+
early_lint, tcx.hir.node_to_string(*id));
12401240
}
12411241
}
12421242

src/librustc/middle/dataflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> {
109109

110110
impl<'a, 'tcx, O:DataFlowOperator> pprust::PpAnn for DataFlowContext<'a, 'tcx, O> {
111111
fn nested(&self, state: &mut pprust::State, nested: pprust::Nested) -> io::Result<()> {
112-
pprust::PpAnn::nested(&self.tcx.map, state, nested)
112+
pprust::PpAnn::nested(&self.tcx.hir, state, nested)
113113
}
114114
fn pre(&self,
115115
ps: &mut pprust::State,

src/librustc/middle/dead.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use syntax_pos;
3535
// may need to be marked as live.
3636
fn should_explore<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
3737
node_id: ast::NodeId) -> bool {
38-
match tcx.map.find(node_id) {
38+
match tcx.hir.find(node_id) {
3939
Some(ast_map::NodeItem(..)) |
4040
Some(ast_map::NodeImplItem(..)) |
4141
Some(ast_map::NodeForeignItem(..)) |
@@ -59,7 +59,7 @@ struct MarkSymbolVisitor<'a, 'tcx: 'a> {
5959

6060
impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
6161
fn check_def_id(&mut self, def_id: DefId) {
62-
if let Some(node_id) = self.tcx.map.as_local_node_id(def_id) {
62+
if let Some(node_id) = self.tcx.hir.as_local_node_id(def_id) {
6363
if should_explore(self.tcx, node_id) {
6464
self.worklist.push(node_id);
6565
}
@@ -68,7 +68,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
6868
}
6969

7070
fn insert_def_id(&mut self, def_id: DefId) {
71-
if let Some(node_id) = self.tcx.map.as_local_node_id(def_id) {
71+
if let Some(node_id) = self.tcx.hir.as_local_node_id(def_id) {
7272
debug_assert!(!should_explore(self.tcx, node_id));
7373
self.live_symbols.insert(node_id);
7474
}
@@ -143,7 +143,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
143143
}
144144
scanned.insert(id);
145145

146-
if let Some(ref node) = self.tcx.map.find(id) {
146+
if let Some(ref node) = self.tcx.hir.find(id) {
147147
self.live_symbols.insert(id);
148148
self.visit_node(node);
149149
}
@@ -203,7 +203,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
203203
fn visit_nested_body(&mut self, body: hir::BodyId) {
204204
let old_tables = self.tables;
205205
self.tables = self.tcx.body_tables(body);
206-
let body = self.tcx.map.body(body);
206+
let body = self.tcx.hir.body(body);
207207
self.visit_body(body);
208208
self.tables = old_tables;
209209
}
@@ -434,7 +434,7 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
434434
}
435435

436436
fn should_warn_about_field(&mut self, field: &hir::StructField) -> bool {
437-
let field_type = self.tcx.item_type(self.tcx.map.local_def_id(field.id));
437+
let field_type = self.tcx.item_type(self.tcx.hir.local_def_id(field.id));
438438
let is_marker_field = match field_type.ty_to_def_id() {
439439
Some(def_id) => self.tcx.lang_items.items().iter().any(|item| *item == Some(def_id)),
440440
_ => false
@@ -478,10 +478,10 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
478478
// method of a private type is used, but the type itself is never
479479
// called directly.
480480
if let Some(impl_list) =
481-
self.tcx.inherent_impls.borrow().get(&self.tcx.map.local_def_id(id)) {
481+
self.tcx.inherent_impls.borrow().get(&self.tcx.hir.local_def_id(id)) {
482482
for &impl_did in impl_list.iter() {
483483
for &item_did in &self.tcx.associated_item_def_ids(impl_did)[..] {
484-
if let Some(item_node_id) = self.tcx.map.as_local_node_id(item_did) {
484+
if let Some(item_node_id) = self.tcx.hir.as_local_node_id(item_did) {
485485
if self.live_symbols.contains(&item_node_id) {
486486
return true;
487487
}
@@ -514,7 +514,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DeadVisitor<'a, 'tcx> {
514514
/// an error. We could do this also by checking the parents, but
515515
/// this is how the code is setup and it seems harmless enough.
516516
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
517-
NestedVisitorMap::All(&self.tcx.map)
517+
NestedVisitorMap::All(&self.tcx.hir)
518518
}
519519

520520
fn visit_item(&mut self, item: &'tcx hir::Item) {
@@ -596,7 +596,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DeadVisitor<'a, 'tcx> {
596596
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
597597
access_levels: &privacy::AccessLevels) {
598598
let _task = tcx.dep_graph.in_task(DepNode::DeadCheck);
599-
let krate = tcx.map.krate();
599+
let krate = tcx.hir.krate();
600600
let live_symbols = find_live(tcx, access_levels, krate);
601601
let mut visitor = DeadVisitor { tcx: tcx, live_symbols: live_symbols };
602602
intravisit::walk_crate(&mut visitor, krate);

src/librustc/middle/effect.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a, 'tcx> Visitor<'tcx> for EffectCheckVisitor<'a, 'tcx> {
101101
fn visit_nested_body(&mut self, body: hir::BodyId) {
102102
let old_tables = self.tables;
103103
self.tables = self.tcx.body_tables(body);
104-
let body = self.tcx.map.body(body);
104+
let body = self.tcx.hir.body(body);
105105
self.visit_body(body);
106106
self.tables = old_tables;
107107
}
@@ -203,7 +203,7 @@ impl<'a, 'tcx> Visitor<'tcx> for EffectCheckVisitor<'a, 'tcx> {
203203
if let Def::Static(def_id, mutbl) = path.def {
204204
if mutbl {
205205
self.require_unsafe(expr.span, "use of mutable static");
206-
} else if match self.tcx.map.get_if_local(def_id) {
206+
} else if match self.tcx.hir.get_if_local(def_id) {
207207
Some(hir::map::NodeForeignItem(..)) => true,
208208
Some(..) => false,
209209
None => self.tcx.sess.cstore.is_foreign_item(def_id),
@@ -249,5 +249,5 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
249249
unsafe_context: UnsafeContext::new(SafeContext),
250250
};
251251

252-
tcx.map.krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
252+
tcx.hir.krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
253253
}

0 commit comments

Comments
 (0)