1
Fork 0

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
This commit is contained in:
Aaron Hill 2020-01-14 14:26:35 -05:00
parent 8a87b945b2
commit 01dc44bfe0
No known key found for this signature in database
GPG key ID: B4087E510E98B164

View file

@ -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
);