1
Fork 0

Use Places to express closure/generator Captures

Co-authored-by: Archer Zhang <archer.xn@gmail.com>
This commit is contained in:
Aman Arora 2020-09-09 01:18:28 -04:00
parent cf9cf7c923
commit 127a6ede1d
6 changed files with 313 additions and 129 deletions

View file

@ -387,8 +387,9 @@ fn make_mirror_unadjusted<'a, 'tcx>(
}
};
let upvars = cx
.tcx
.upvars_mentioned(def_id)
.typeck_results()
.closure_captures
.get(&def_id)
.iter()
.flat_map(|upvars| upvars.iter())
.zip(substs.upvar_tys())