diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2018-12-04 19:14:13 +0000 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2018-12-04 22:14:07 +0100 |
| commit | f41b48a10e0c5c934f284bc29852ba44ef7e3fbf (patch) | |
| tree | 048c74798cdef64531510cb54cd487eba53b809e | |
| parent | 6b4e2971d74318491c168ae52960274e8f18fcd1 (diff) | |
| download | rust-f41b48a10e0c5c934f284bc29852ba44ef7e3fbf.tar.gz rust-f41b48a10e0c5c934f284bc29852ba44ef7e3fbf.zip | |
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.
| -rw-r--r-- | src/librustc_typeck/check/wfcheck.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 9990d2ee2b6..75207f18ab1 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -343,8 +343,8 @@ fn check_item_fn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item: &hir::Item) { fn check_item_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId, ty_span: Span) { debug!("check_item_type: {:?}", item_id); - for_id(tcx, item_id, ty_span).with_fcx(|fcx, _this| { - let ty = fcx.tcx.type_of(fcx.tcx.hir.local_def_id(item_id)); + for_id(tcx, item_id, ty_span).with_fcx(|fcx, gcx| { + let ty = gcx.type_of(gcx.hir.local_def_id(item_id)); let item_ty = fcx.normalize_associated_types_in(ty_span, &ty); fcx.register_wf_obligation(item_ty, ty_span, ObligationCauseCode::MiscObligation); |
