From cf2433a74f7474f7d41e9842d7de465b0966831a Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Tue, 12 Jul 2022 09:10:22 -0500 Subject: Use LocalDefId for closures more --- compiler/rustc_const_eval/src/interpret/validity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval') diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index d20f16755c3..6f6717721fb 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -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). -- cgit 1.4.1-3-g733a5