diff options
| author | Celina G. Val <celinval@amazon.com> | 2023-11-07 14:11:15 -0800 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2023-11-16 11:05:36 -0800 |
| commit | 3f87dac9a255aaf26a3481575444b67b46cf913f (patch) | |
| tree | 17af1131d339368b15c6131f0d996a7e04bd9435 | |
| parent | e70839ac84aa3dc8b4525a11e64961e375f8f3ba (diff) | |
| download | rust-3f87dac9a255aaf26a3481575444b67b46cf913f.tar.gz rust-3f87dac9a255aaf26a3481575444b67b46cf913f.zip | |
Fix bug on MIRVisitor
We were not iterating over all local variables due to a typo.
| -rw-r--r-- | compiler/stable_mir/src/mir/visit.rs | 4 |
1 files 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 @@ pub trait MirVisitor { } 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 @@ pub trait MirVisitor { 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 { |
