Skip to content

Commit 3b6ac15

Browse files
committed
Fix ICE from logging
`hir_id` could be the crate root ID here, in which case `get` will panic.
1 parent 59c1db0 commit 3b6ac15

File tree

1 file changed

+1
-1
lines changed
  • src/librustc/infer/opaque_types

1 file changed

+1
-1
lines changed

src/librustc/infer/opaque_types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ pub fn may_define_opaque_type(tcx: TyCtxt<'_>, def_id: DefId, opaque_hir_id: hir
12191219
let res = hir_id == scope;
12201220
trace!(
12211221
"may_define_opaque_type(def={:?}, opaque_node={:?}) = {}",
1222-
tcx.hir().get(hir_id),
1222+
tcx.hir().find(hir_id),
12231223
tcx.hir().get(opaque_hir_id),
12241224
res
12251225
);

0 commit comments

Comments
 (0)