Change the key of UpvarListMap from DefId to ast::NodeId
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
-pub type UpvarListMap<'tcx> = FxHashMap<DefId, Vec<UpvarId>>;
-
impl<'tcx> serialize::UseSpecializedEncodable for Ty<'tcx> {}
impl<'tcx> serialize::UseSpecializedDecodable for Ty<'tcx> {}
pub region: ty::Region<'tcx>,
}
+pub type UpvarListMap<'tcx> = FxHashMap<ast::NodeId, Vec<UpvarId>>;
pub type UpvarCaptureMap<'tcx> = FxHashMap<UpvarId, UpvarCapture<'tcx>>;
#[derive(Copy, Clone)]
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| {
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());