Skip to content

Commit

Permalink
HirIdification: remove all NodeIds from rustc_mir
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Mar 10, 2019
1 parent aa53741 commit 9151eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/librustc_mir/borrow_check/nll/universal_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use rustc::util::nodemap::FxHashMap;
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use rustc_errors::DiagnosticBuilder;
use std::iter;
use syntax::ast;

use super::ToRegionVid;

Expand Down Expand Up @@ -200,12 +199,10 @@ impl<'tcx> UniversalRegions<'tcx> {
param_env: ty::ParamEnv<'tcx>,
) -> Self {
let tcx = infcx.tcx;
let mir_node_id = tcx.hir().as_local_node_id(mir_def_id).unwrap();
let mir_hir_id = tcx.hir().node_to_hir_id(mir_node_id);
let mir_hir_id = tcx.hir().as_local_hir_id(mir_def_id).unwrap();
UniversalRegionsBuilder {
infcx,
mir_def_id,
mir_node_id,
mir_hir_id,
param_env,
}.build()
Expand Down Expand Up @@ -370,7 +367,6 @@ struct UniversalRegionsBuilder<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
infcx: &'cx InferCtxt<'cx, 'gcx, 'tcx>,
mir_def_id: DefId,
mir_hir_id: HirId,
mir_node_id: ast::NodeId,
param_env: ty::ParamEnv<'tcx>,
}

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

match tcx.hir().body_owner_kind(self.mir_node_id) {
match tcx.hir().body_owner_kind_by_hir_id(self.mir_hir_id) {
BodyOwnerKind::Closure |
BodyOwnerKind::Fn => {
let defining_ty = if self.mir_def_id == closure_base_def_id {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ struct Builder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
/// finish building it.
guard_context: Vec<GuardFrame>,

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

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

Expand Down

0 comments on commit 9151eab

Please sign in to comment.