diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-06-16 17:30:53 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-06-17 18:59:27 +0200 |
| commit | 21fbb59500ec50bab7e8a2b00af8a00c967f6b76 (patch) | |
| tree | dbfd5498d85bded89d1fd61926c2b51fbbd97476 | |
| parent | 1c8551b0ebb4efc72dd1d57035672e5b1c915ac2 (diff) | |
| download | rust-21fbb59500ec50bab7e8a2b00af8a00c967f6b76.tar.gz rust-21fbb59500ec50bab7e8a2b00af8a00c967f6b76.zip | |
fix a HIR doc, simplify one HIR-related function call
| -rw-r--r-- | src/librustc/cfg/construct.rs | 3 | ||||
| -rw-r--r-- | 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 8f0f832b6c4..85602320f0b 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 26c08154647..18b8d23a455 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 { |
