Use LocalDefId for closures more

This commit is contained in:
Cameron Steffen 2022-07-12 09:10:22 -05:00
parent 1202bbaf48
commit cf2433a74f
29 changed files with 164 additions and 171 deletions

View file

@ -238,7 +238,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
if let Some(local_def_id) = def_id.as_local() {
let tables = self.ecx.tcx.typeck(local_def_id);
if let Some(captured_place) =
tables.closure_min_captures_flattened(*def_id).nth(field)
tables.closure_min_captures_flattened(local_def_id).nth(field)
{
// Sometimes the index is beyond the number of upvars (seen
// for a generator).