Skip to content

Commit b2e6da7

Browse files
committed
Call methods on the right tcx
There are two `TyCtxt`s, one global, one local. Methods must be called on the right one, as they differ by invariant lifetimes.
1 parent d748712 commit b2e6da7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_typeck/check/wfcheck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@ fn check_item_type<'a, 'tcx>(
355355
) {
356356
debug!("check_item_type: {:?}", item_id);
357357

358-
for_id(tcx, item_id, ty_span).with_fcx(|fcx, _this| {
359-
let ty = fcx.tcx.type_of(fcx.tcx.hir.local_def_id(item_id));
358+
for_id(tcx, item_id, ty_span).with_fcx(|fcx, gcx| {
359+
let ty = gcx.type_of(gcx.hir.local_def_id(item_id));
360360
let item_ty = fcx.normalize_associated_types_in(ty_span, &ty);
361361

362362
let mut forbid_unsized = true;
363363
if allow_foreign_ty {
364-
if let TyKind::Foreign(_) = tcx.struct_tail(item_ty).sty {
364+
if let TyKind::Foreign(_) = fcx.tcx.struct_tail(item_ty).sty {
365365
forbid_unsized = false;
366366
}
367367
}

0 commit comments

Comments
 (0)