HirIdification: remove all NodeIds from rustc_mir
This commit is contained in:
parent
aa53741927
commit
9151eabf97
2 changed files with 4 additions and 8 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -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()
|
||||
|
|
@ -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>,
|
||||
}
|
||||
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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>>,
|
||||
|
|
@ -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),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue