Skip to content

Commit 87438a1

Browse files
committed
HirIdification: miscellaneous bits
1 parent d82a12f commit 87438a1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustc/middle/liveness.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ use std::{fmt, u32};
110110
use std::io::prelude::*;
111111
use std::io;
112112
use std::rc::Rc;
113-
use syntax::ast::{self, NodeId};
113+
use syntax::ast;
114114
use syntax::ptr::P;
115115
use syntax::symbol::{kw, sym};
116116
use syntax_pos::Span;
@@ -1327,12 +1327,11 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13271327
}
13281328
}
13291329

1330-
fn access_var(&mut self, hir_id: HirId, nid: NodeId, succ: LiveNode, acc: u32, span: Span)
1330+
fn access_var(&mut self, hir_id: HirId, var_hid: HirId, succ: LiveNode, acc: u32, span: Span)
13311331
-> LiveNode {
13321332
let ln = self.live_node(hir_id, span);
13331333
if acc != 0 {
13341334
self.init_from_succ(ln, succ);
1335-
let var_hid = self.ir.tcx.hir().node_to_hir_id(nid);
13361335
let var = self.variable(var_hid, span);
13371336
self.acc(ln, var, acc);
13381337
}
@@ -1345,8 +1344,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13451344
Res::Local(hid) => {
13461345
let upvars = self.ir.tcx.upvars(self.ir.body_owner);
13471346
if !upvars.map_or(false, |upvars| upvars.contains_key(&hid)) {
1348-
let nid = self.ir.tcx.hir().hir_to_node_id(hid);
1349-
self.access_var(hir_id, nid, succ, acc, path.span)
1347+
self.access_var(hir_id, hid, succ, acc, path.span)
13501348
} else {
13511349
succ
13521350
}

src/librustc/ty/inhabitedness/def_id_forest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::mem;
22
use smallvec::SmallVec;
3-
use syntax::ast::CRATE_NODE_ID;
3+
use rustc::hir::CRATE_HIR_ID;
44
use crate::ty::context::TyCtxt;
55
use crate::ty::{DefId, DefIdTree};
66

@@ -33,7 +33,7 @@ impl<'tcx> DefIdForest {
3333
/// crate.
3434
#[inline]
3535
pub fn full(tcx: TyCtxt<'tcx>) -> DefIdForest {
36-
let crate_id = tcx.hir().local_def_id(CRATE_NODE_ID);
36+
let crate_id = tcx.hir().local_def_id_from_hir_id(CRATE_HIR_ID);
3737
DefIdForest::from_id(crate_id)
3838
}
3939

0 commit comments

Comments
 (0)