Skip to content

Commit 9151eab

Browse files
committed
HirIdification: remove all NodeIds from rustc_mir
1 parent aa53741 commit 9151eab

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/librustc_mir/borrow_check/nll/universal_regions.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use rustc::util::nodemap::FxHashMap;
2323
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
2424
use rustc_errors::DiagnosticBuilder;
2525
use std::iter;
26-
use syntax::ast;
2726

2827
use super::ToRegionVid;
2928

@@ -200,12 +199,10 @@ impl<'tcx> UniversalRegions<'tcx> {
200199
param_env: ty::ParamEnv<'tcx>,
201200
) -> Self {
202201
let tcx = infcx.tcx;
203-
let mir_node_id = tcx.hir().as_local_node_id(mir_def_id).unwrap();
204-
let mir_hir_id = tcx.hir().node_to_hir_id(mir_node_id);
202+
let mir_hir_id = tcx.hir().as_local_hir_id(mir_def_id).unwrap();
205203
UniversalRegionsBuilder {
206204
infcx,
207205
mir_def_id,
208-
mir_node_id,
209206
mir_hir_id,
210207
param_env,
211208
}.build()
@@ -370,7 +367,6 @@ struct UniversalRegionsBuilder<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
370367
infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>,
371368
mir_def_id: DefId,
372369
mir_hir_id: HirId,
373-
mir_node_id: ast::NodeId,
374370
param_env: ty::ParamEnv<'tcx>,
375371
}
376372

@@ -475,7 +471,7 @@ impl<'cx, 'gcx, 'tcx> UniversalRegionsBuilder<'cx, 'gcx, 'tcx> {
475471
let tcx = self.infcx.tcx;
476472
let closure_base_def_id = tcx.closure_base_def_id(self.mir_def_id);
477473

478-
match tcx.hir().body_owner_kind(self.mir_node_id) {
474+
match tcx.hir().body_owner_kind_by_hir_id(self.mir_hir_id) {
479475
BodyOwnerKind::Closure |
480476
BodyOwnerKind::Fn => {
481477
let defining_ty = if self.mir_def_id == closure_base_def_id {

src/librustc_mir/build/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
373373
/// finish building it.
374374
guard_context: Vec<GuardFrame>,
375375

376-
/// Maps `NodeId`s of variable bindings to the `Local`s created for them.
376+
/// Maps `HirId`s of variable bindings to the `Local`s created for them.
377377
/// (A match binding can have two locals; the 2nd is for the arm's guard.)
378378
var_indices: HirIdMap<LocalsForNode>,
379379
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
@@ -451,7 +451,7 @@ impl BlockContext {
451451

452452
#[derive(Debug)]
453453
enum LocalsForNode {
454-
/// In the usual case, a `NodeId` for an identifier maps to at most
454+
/// In the usual case, a `HirId` for an identifier maps to at most
455455
/// one `Local` declaration.
456456
One(Local),
457457

0 commit comments

Comments
 (0)