Skip to content

Commit 21fbb59

Browse files
committed
fix a HIR doc, simplify one HIR-related function call
1 parent 1c8551b commit 21fbb59

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/librustc/cfg/construct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ pub fn construct<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG {
4242
let body_exit;
4343

4444
// Find the tables for this body.
45-
let owner_hir_id = tcx.hir().body_owner(body.id());
46-
let owner_def_id = tcx.hir().local_def_id_from_hir_id(owner_hir_id);
45+
let owner_def_id = tcx.hir().body_owner_def_id(body.id());
4746
let tables = tcx.typeck_tables_of(owner_def_id);
4847

4948
let mut cfg_builder = CFGBuilder {

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl<'hir> Map<'hir> {
420420
}
421421
}
422422

423-
/// Returns the `NodeId` that corresponds to the definition of
423+
/// Returns the `HirId` that corresponds to the definition of
424424
/// which this is the body of, i.e., a `fn`, `const` or `static`
425425
/// item (possibly associated), a closure, or a `hir::AnonConst`.
426426
pub fn body_owner(&self, BodyId { hir_id }: BodyId) -> HirId {

0 commit comments

Comments
 (0)