From 3f87dac9a255aaf26a3481575444b67b46cf913f Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Tue, 7 Nov 2023 14:11:15 -0800 Subject: [PATCH] Fix bug on MIRVisitor We were not iterating over all local variables due to a typo. --- compiler/stable_mir/src/mir/visit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/stable_mir/src/mir/visit.rs b/compiler/stable_mir/src/mir/visit.rs index 475d6e9763d..d6304d3ea39 100644 --- a/compiler/stable_mir/src/mir/visit.rs +++ b/compiler/stable_mir/src/mir/visit.rs @@ -142,7 +142,7 @@ fn super_body(&mut self, body: &Body) { } let local_start = arg_count + 1; - for (idx, arg) in body.arg_locals().iter().enumerate() { + for (idx, arg) in body.inner_locals().iter().enumerate() { self.visit_local_decl(idx + local_start, arg) } } @@ -417,7 +417,7 @@ fn super_assert_msg(&mut self, msg: &AssertMessage, location: Location) { fn visit_opaque(_: &Opaque) {} /// The location of a statement / terminator in the code and the CFG. -#[derive(Clone, Copy, PartialEq, Eq)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct Location(Span); impl Location {