diff options
| author | Blitzerr <rusty.blitzerr@gmail.com> | 2018-12-21 20:00:11 -0800 |
|---|---|---|
| committer | Blitzerr <rusty.blitzerr@gmail.com> | 2019-01-08 17:57:22 -0800 |
| commit | 7853b780fc678e670362690ddeb8648d552db0bf (patch) | |
| tree | 091290c197612288e388a89b2db4f44442abe7e9 /src | |
| parent | 410b52958da4434c2638da15e6c6c9a7ef665761 (diff) | |
| download | rust-7853b780fc678e670362690ddeb8648d552db0bf.tar.gz rust-7853b780fc678e670362690ddeb8648d552db0bf.zip | |
Some more refactoring.
Change the key of UpvarListMap from DefId to ast::NodeId
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/ty/mod.rs | 3 | ||||
| -rw-r--r-- | src/librustc_mir/build/mod.rs | 1 | ||||
| -rw-r--r-- | src/librustc_typeck/check/upvar.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index f770f2bf7b1..8afe0241ac8 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -589,8 +589,6 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ty::TyS<'gcx> { 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> {} @@ -810,6 +808,7 @@ pub struct UpvarBorrow<'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)] diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 727b769cf4d..4b0907f8083 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 2a50f63b792..24d13d9c2ac 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()); |
