about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authormarmeladema <xademax@gmail.com>2020-04-12 13:45:41 +0100
committermarmeladema <xademax@gmail.com>2020-04-23 23:14:07 +0100
commit6148db719f34a35099eff46097b5d2d9770892e9 (patch)
treefea7df58a9c88ef2cada621f44cb3ccbafc2d9f7 /src/librustc_codegen_ssa
parent92fb59d7f37596f91b8d4619c4d146f273349b4c (diff)
Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/back/symbol_export.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs
index 38a5f8d6d71..5970059bb4c 100644
--- a/src/librustc_codegen_ssa/back/symbol_export.rs
+++ b/src/librustc_codegen_ssa/back/symbol_export.rs
@@ -361,8 +361,8 @@ fn upstream_drop_glue_for_provider<'tcx>(
 }
 
 fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
-    if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) {
-        !tcx.reachable_set(LOCAL_CRATE).contains(&hir_id)
+    if let Some(def_id) = def_id.as_local() {
+        !tcx.reachable_set(LOCAL_CRATE).contains(&tcx.hir().as_local_hir_id(def_id).unwrap())
     } else {
         bug!("is_unreachable_local_definition called with non-local DefId: {:?}", def_id)
     }