]> git.lizzy.rs Git - rust.git/commitdiff
fix a HIR doc, simplify one HIR-related function call
authorljedrz <ljedrz@gmail.com>
Sun, 16 Jun 2019 15:30:53 +0000 (17:30 +0200)
committerljedrz <ljedrz@gmail.com>
Mon, 17 Jun 2019 16:59:27 +0000 (18:59 +0200)
src/librustc/cfg/construct.rs
src/librustc/hir/map/mod.rs

index 8f0f832b6c418c322d7aa61736262f230091025b..85602320f0b0d9a9867f8016d389734c90280d3c 100644 (file)
@@ -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 {
index 26c08154647e29069cc1618f7fc97bf78051df5a..18b8d23a455c99aa5c6efdd89c25df3a60e85e64 100644 (file)
@@ -420,7 +420,7 @@ pub fn fn_decl_by_hir_id(&self, hir_id: HirId) -> Option<FnDecl> {
         }
     }
 
-    /// 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 {