From 21fbb59500ec50bab7e8a2b00af8a00c967f6b76 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Sun, 16 Jun 2019 17:30:53 +0200 Subject: [PATCH] fix a HIR doc, simplify one HIR-related function call --- src/librustc/cfg/construct.rs | 3 +-- src/librustc/hir/map/mod.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index 8f0f832b6c41..85602320f0b0 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -42,8 +42,7 @@ pub fn construct<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG { let body_exit; // Find the tables for this body. - let owner_hir_id = tcx.hir().body_owner(body.id()); - let owner_def_id = tcx.hir().local_def_id_from_hir_id(owner_hir_id); + let owner_def_id = tcx.hir().body_owner_def_id(body.id()); let tables = tcx.typeck_tables_of(owner_def_id); let mut cfg_builder = CFGBuilder { diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 26c08154647e..18b8d23a455c 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -420,7 +420,7 @@ impl<'hir> Map<'hir> { } } - /// Returns the `NodeId` that corresponds to the definition of + /// Returns the `HirId` that corresponds to the definition of /// which this is the body of, i.e., a `fn`, `const` or `static` /// item (possibly associated), a closure, or a `hir::AnonConst`. pub fn body_owner(&self, BodyId { hir_id }: BodyId) -> HirId {