about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-01-14 14:26:35 -0500
committerAaron Hill <aa1ronham@gmail.com>2020-01-14 16:41:43 -0500
commit01dc44bfe00e374cf769cee5757d0ac97faa15a2 (patch)
treeea09b1b58e7245a018e6ac0bf38789692a61fdf6
parent8a87b945b27b5670ac5ed665bbb0fccc1b88a0a0 (diff)
downloadrust-01dc44bfe00e374cf769cee5757d0ac97faa15a2.tar.gz
rust-01dc44bfe00e374cf769cee5757d0ac97faa15a2.zip
Avoid calling tcx.hir().get() on CRATE_HIR_ID
This was causing an ICE when enabling trace logging for an unrelated
module, since the arguments to `trace!` ended up getting evaluated
-rw-r--r--src/librustc/infer/opaque_types/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs
index a1afb1a86be..ee214bea7b8 100644
--- a/src/librustc/infer/opaque_types/mod.rs
+++ b/src/librustc/infer/opaque_types/mod.rs
@@ -1219,7 +1219,7 @@ pub fn may_define_opaque_type(tcx: TyCtxt<'_>, def_id: DefId, opaque_hir_id: hir
     let res = hir_id == scope;
     trace!(
         "may_define_opaque_type(def={:?}, opaque_node={:?}) = {}",
-        tcx.hir().get(hir_id),
+        tcx.hir().find(hir_id),
         tcx.hir().get(opaque_hir_id),
         res
     );