Rollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasper

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:
Yuki Okushi 2020-01-15 21:51:52 +09:00 committed by GitHub
commit 38ca7b707e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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