summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_const_eval/src/interpret/visitor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/visitor.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/visitor.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/visitor.rs b/compiler/rustc_const_eval/src/interpret/visitor.rs
index 531e2bd3e..fc21ad1f1 100644
--- a/compiler/rustc_const_eval/src/interpret/visitor.rs
+++ b/compiler/rustc_const_eval/src/interpret/visitor.rs
@@ -170,8 +170,9 @@ pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized {
}
}
FieldsShape::Array { .. } => {
- for (idx, field) in self.ecx().project_array_fields(v)?.enumerate() {
- self.visit_field(v, idx, &field?)?;
+ let mut iter = self.ecx().project_array_fields(v)?;
+ while let Some((idx, field)) = iter.next(self.ecx())? {
+ self.visit_field(v, idx.try_into().unwrap(), &field)?;
}
}
}