fix a HIR doc, simplify one HIR-related function call

This commit is contained in:
ljedrz 2019-06-16 17:30:53 +02:00
parent 1c8551b0eb
commit 21fbb59500
2 changed files with 2 additions and 3 deletions

View 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 {

View file

@ -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 {