Skip to content

Commit 3f87dac

Browse files
committed
Fix bug on MIRVisitor
We were not iterating over all local variables due to a typo.
1 parent e70839a commit 3f87dac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/stable_mir/src/mir/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub trait MirVisitor {
142142
}
143143

144144
let local_start = arg_count + 1;
145-
for (idx, arg) in body.arg_locals().iter().enumerate() {
145+
for (idx, arg) in body.inner_locals().iter().enumerate() {
146146
self.visit_local_decl(idx + local_start, arg)
147147
}
148148
}
@@ -417,7 +417,7 @@ pub trait MirVisitor {
417417
fn visit_opaque(_: &Opaque) {}
418418

419419
/// The location of a statement / terminator in the code and the CFG.
420-
#[derive(Clone, Copy, PartialEq, Eq)]
420+
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
421421
pub struct Location(Span);
422422

423423
impl Location {

0 commit comments

Comments
 (0)