diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index f770f2bf7b12..8afe0241ac86 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -589,8 +589,6 @@ impl<'a, 'gcx> HashStable> for ty::TyS<'gcx> { pub type Ty<'tcx> = &'tcx TyS<'tcx>; -pub type UpvarListMap<'tcx> = FxHashMap>; - impl<'tcx> serialize::UseSpecializedEncodable for Ty<'tcx> {} impl<'tcx> serialize::UseSpecializedDecodable for Ty<'tcx> {} @@ -810,6 +808,7 @@ pub struct UpvarBorrow<'tcx> { pub region: ty::Region<'tcx>, } +pub type UpvarListMap<'tcx> = FxHashMap>; pub type UpvarCaptureMap<'tcx> = FxHashMap>; #[derive(Copy, Clone)] diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 727b769cf4d4..4b0907f80836 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -642,6 +642,7 @@ fn construct_fn<'a, 'gcx, 'tcx, A>(hir: Cx<'a, 'gcx, 'tcx>, let tcx = hir.tcx(); let span = tcx.hir().span(fn_id); + // hir.tables().upvar_list[fn_id]. // Gather the upvars of a closure, if any. let upvar_decls: Vec<_> = tcx.with_freevars(fn_id, |freevars| { freevars.iter().map(|fv| { diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index 2a50f63b7925..24d13d9c2acf 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -159,7 +159,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tables .borrow_mut() .upvar_list - .insert(closure_def_id, freevar_list); + .insert(closure_node_id, freevar_list); }); let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id());